From da729a449b4f0a0c80c0407fbf4aed0eaf28c98e Mon Sep 17 00:00:00 2001 From: Dragon Dave McKee Date: Wed, 5 Jun 2024 11:27:19 +0100 Subject: [PATCH] Crash if NOTIFY_API_KEY not set and email is attempted to be sent --- ds-caselaw-ingester/lambda_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ds-caselaw-ingester/lambda_function.py b/ds-caselaw-ingester/lambda_function.py index 3076aa0..7355e25 100644 --- a/ds-caselaw-ingester/lambda_function.py +++ b/ds-caselaw-ingester/lambda_function.py @@ -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"), @@ -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"),