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

Task #11254: notify recipients (like sos) when no PI/CO email address can be found

parent 0430111b
No related branches found
No related tags found
No related merge requests found
......@@ -1045,7 +1045,6 @@ Total Files: %(total)i
done_group_jobs = [jad['job'] for jad in done_group_jads]
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_error_msg = None
try:
if len(unfinished_group_jads) == 0:
......@@ -1063,10 +1062,14 @@ Total Files: %(total)i
extra_mail_addresses.append(project_details['pi_email'])
if project_details and 'author_email' in project_details:
extra_mail_addresses.append(project_details['author_email'])
if not extra_mail_addresses:
report += '\n\nCould not find any PI\'s/Contact-author\'s email address in MoM to sent this email to.'
except Exception as 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
msg = 'error while trying to get PI\'s/Contact-author\'s email address for %s: %s' % (job_group_id, e)
logger.error(msg)
report += '\n\n' + msg
# submitters might contain comma seperated strings
# 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