Skip to content

Commit

Permalink
Bug fix for _build_recipients_from_task_log()
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-pond committed Oct 13, 2024
1 parent 5174b43 commit c3f93db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions btu/btu_core/btu_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,19 @@ def _build_recipients_from_task_log(doc_task_log) -> dict:
for each_recipient in doc_schedule.email_recipients:

# Add new key to dictionary:
if not result.get(each_recipient):
result[each_recipient] = {
if not result.get(each_recipient.email_address):
result[each_recipient.email_address] = {
"email_on_start": each_recipient.email_on_start,
"email_on_success": each_recipient.email_on_success,
"email_on_error": each_recipient.email_on_error,
"email_on_timeout": each_recipient.email_on_timeout
}
else:
# Apply "or" logic to each selection:
result[each_recipient]["email_on_start"] = result[each_recipient]["email_on_start"] or each_recipient.email_on_start
result[each_recipient]["email_on_success"] = result[each_recipient]["email_on_success"] or each_recipient.email_on_success
result[each_recipient]["email_on_error"] = result[each_recipient]["email_on_error"] or each_recipient.email_on_error
result[each_recipient]["email_on_timeout"] = result[each_recipient]["email_on_timeout"] or each_recipient.email_on_timeout
result[each_recipient.email_address]["email_on_start"] = result[each_recipient.email_address]["email_on_start"] or each_recipient.email_on_start
result[each_recipient.email_address]["email_on_success"] = result[each_recipient.email_address]["email_on_success"] or each_recipient.email_on_success
result[each_recipient.email_address]["email_on_error"] = result[each_recipient.email_address]["email_on_error"] or each_recipient.email_on_error
result[each_recipient.email_address]["email_on_timeout"] = result[each_recipient.email_address]["email_on_timeout"] or each_recipient.email_on_timeout

return result

Expand Down

0 comments on commit c3f93db

Please sign in to comment.