Skip to content

Commit

Permalink
Crash if NOTIFY_API_KEY not set and email is attempted to be sent
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-dxw committed Jun 5, 2024
1 parent 7918bdc commit da729a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ds-caselaw-ingester/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def send_updated_judgment_notification(self) -> None:
)
return

notifications_client = NotificationsAPIClient(os.getenv("NOTIFY_API_KEY"))
notifications_client = NotificationsAPIClient(os.environ["NOTIFY_API_KEY"])
response = notifications_client.send_email_notification(
email_address=os.getenv("NOTIFY_EDITORIAL_ADDRESS"),
template_id=os.getenv("NOTIFY_UPDATED_JUDGMENT_TEMPLATE_ID"),
Expand All @@ -485,7 +485,7 @@ def send_new_judgment_notification(self) -> None:
f"Would send a notification but we're not in production.\n{personalisation}"
)
return
notifications_client = NotificationsAPIClient(os.getenv("NOTIFY_API_KEY"))
notifications_client = NotificationsAPIClient(os.environ["NOTIFY_API_KEY"])
response = notifications_client.send_email_notification(
email_address=os.getenv("NOTIFY_EDITORIAL_ADDRESS"),
template_id=os.getenv("NOTIFY_NEW_JUDGMENT_TEMPLATE_ID"),
Expand Down

0 comments on commit da729a4

Please sign in to comment.