Skip to content

Commit

Permalink
Raise reasonable error when EMPRO patient can't receive email message
Browse files Browse the repository at this point in the history
  • Loading branch information
pbugni committed Feb 9, 2024
1 parent 3a983ec commit 521aaf5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions portal/trigger_states/empro_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,13 @@ def process_processed(ts):
patient = User.query.get(ts.user_id)

# Patient always gets mail
pending_emails.append((
patient_email(patient, soft_triggers, hard_triggers),
"patient thank you"))
if patient.email_ready():
pending_emails.append((
patient_email(patient, soft_triggers, hard_triggers),
"patient thank you"))
else:
current_app.logger.error(
f"EMPRO Patient({patient.id}) w/o email! Can't send message")

if hard_triggers:
triggers['action_state'] = 'required'
Expand Down

0 comments on commit 521aaf5

Please sign in to comment.