Skip to content
Snippets Groups Projects
Commit 0430111b authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #11254: notify recipients (like sos) when PI/CO email address cannot be retreived

parent 69e04604
No related branches found
No related tags found
No related merge requests found
...@@ -1045,6 +1045,7 @@ Total Files: %(total)i ...@@ -1045,6 +1045,7 @@ Total Files: %(total)i
done_group_jobs = [jad['job'] for jad in done_group_jads] done_group_jobs = [jad['job'] for jad in done_group_jads]
submitters = [j['Submitter'] for j in done_group_jobs if 'Submitter' in j] submitters = [j['Submitter'] for j in done_group_jobs if 'Submitter' in j]
extra_mail_addresses = [j['email'] for j in done_group_jobs if 'email' in j] extra_mail_addresses = [j['email'] for j in done_group_jobs if 'email' in j]
extra_mail_addresses_error_msg = None
try: try:
if len(unfinished_group_jads) == 0: if len(unfinished_group_jads) == 0:
...@@ -1063,7 +1064,9 @@ Total Files: %(total)i ...@@ -1063,7 +1064,9 @@ Total Files: %(total)i
if project_details and 'author_email' in project_details: if project_details and 'author_email' in project_details:
extra_mail_addresses.append(project_details['author_email']) extra_mail_addresses.append(project_details['author_email'])
except Exception as e: except Exception as e:
logger.error('error while trying to get PI\'s/Contact-author\'s email address for %s: %s', job_group_id, e) extra_mail_addresses_error_msg = 'error while trying to get PI\'s/Contact-author\'s email address for %s: %s' % (job_group_id, e)
logger.error(extra_mail_addresses_error_msg)
report += '\n\n' + extra_mail_addresses_error_msg
# submitters might contain comma seperated strings # submitters might contain comma seperated strings
# join all sumbitterstrings in one long csv string, split it, and get the unique submitters # join all sumbitterstrings in one long csv string, split it, and get the unique submitters
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment