Skip to content
Snippets Groups Projects

MAINT: make send_mail in crawler static

+ 4
4
@@ -430,7 +430,7 @@ class Crawler(object):
@@ -430,7 +430,7 @@ class Crawler(object):
if "SHARED_DIR" in os.environ:
if "SHARED_DIR" in os.environ:
filename = Crawler.save_form([el[3]
filename = Crawler.save_form([el[3]
for el in pending_changes], path, self.run_id)
for el in pending_changes], path, self.run_id)
self.send_mail([el[3] for el in pending_changes], filename)
Crawler.send_mail([el[3] for el in pending_changes], filename)
for i, el in enumerate(pending_changes):
for i, el in enumerate(pending_changes):
@@ -441,8 +441,7 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
@@ -441,8 +441,7 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
logger.info("There where unauthorized changes (see above). An "
logger.info("There where unauthorized changes (see above). An "
"email was sent to the curator.\n"
"email was sent to the curator.\n"
"You can authorize the updates by invoking the crawler"
"You can authorize the updates by invoking the crawler"
" with the run id: {rid}\n".format(rid=self.run_id,
" with the run id: {rid}\n".format(rid=self.run_id))
path=path))
if len(DataModelProblems.missing) > 0:
if len(DataModelProblems.missing) > 0:
err_msg = ("There were problems with one or more RecordType or "
err_msg = ("There were problems with one or more RecordType or "
@@ -562,7 +561,8 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
@@ -562,7 +561,8 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
f.write(form)
f.write(form)
return filename
return filename
def send_mail(self, changes, filename):
@staticmethod
 
def send_mail(changes, filename):
""" calls sendmail in order to send a mail to the curator about pending
""" calls sendmail in order to send a mail to the curator about pending
changes
changes
Loading