From 9dcd7b21ed0fcc49332f70c20f774f878c010c5b Mon Sep 17 00:00:00 2001 From: David McKee Date: Thu, 15 Dec 2022 12:07:46 +0000 Subject: [PATCH] Email notifications should trigger on correct spelling of ROLLBAR_ENV, prod --- ds-caselaw-ingester/lambda_function.py | 4 ++-- ds-caselaw-ingester/tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ds-caselaw-ingester/lambda_function.py b/ds-caselaw-ingester/lambda_function.py index ad12086..918f63f 100644 --- a/ds-caselaw-ingester/lambda_function.py +++ b/ds-caselaw-ingester/lambda_function.py @@ -151,7 +151,7 @@ def store_file(file, folder, filename, s3_client: Session.client): def send_new_judgment_notification(uri: str, metadata: dict): - if os.getenv("ROLLBAR_ENV") == "production": + if os.getenv("ROLLBAR_ENV") == "prod": tdr_metadata = metadata["parameters"]["TDR"] notifications_client = NotificationsAPIClient(os.getenv("NOTIFY_API_KEY")) response = notifications_client.send_email_notification( @@ -171,7 +171,7 @@ def send_new_judgment_notification(uri: str, metadata: dict): def send_updated_judgment_notification(uri: str, metadata: dict): - if os.getenv("ROLLBAR_ENV") == "production": + if os.getenv("ROLLBAR_ENV") == "prod": tdr_metadata = metadata["parameters"]["TDR"] notifications_client = NotificationsAPIClient(os.getenv("NOTIFY_API_KEY")) response = notifications_client.send_email_notification( diff --git a/ds-caselaw-ingester/tests.py b/ds-caselaw-ingester/tests.py index 3654888..2ab0b5e 100644 --- a/ds-caselaw-ingester/tests.py +++ b/ds-caselaw-ingester/tests.py @@ -207,7 +207,7 @@ def test_store_file_file_no_credentials(self, mock_print): "EDITORIAL_UI_BASE_URL": "http://editor.url/", "NOTIFY_EDITORIAL_ADDRESS": "test@notifications.service.gov.uk", "NOTIFY_NEW_JUDGMENT_TEMPLATE_ID": "template-id", - "ROLLBAR_ENV": "production", + "ROLLBAR_ENV": "prod", }, clear=True, ) @@ -261,7 +261,7 @@ def test_do_not_send_new_judgment_notification_on_staging(self, mock_print): "EDITORIAL_UI_BASE_URL": "http://editor.url/", "NOTIFY_EDITORIAL_ADDRESS": "test@notifications.service.gov.uk", "NOTIFY_UPDATED_JUDGMENT_TEMPLATE_ID": "template-id", - "ROLLBAR_ENV": "production", + "ROLLBAR_ENV": "prod", }, clear=True, )