Skip to content
Snippets Groups Projects
Commit 6de42175 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-sendmail' into 'dev'

MAINT: make send_mail in crawler static

See merge request !48
parents 9a1f3e3b a2207fd5
No related branches found
No related tags found
2 merge requests!54REL: Release 0.5.0,!48MAINT: make send_mail in crawler static
Pipeline #26546 passed
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment