Skip to content

Commit

Permalink
Merge pull request #54 from nationalarchives/rollbar-is-prod-notifica…
Browse files Browse the repository at this point in the history
…tions

Email notifications should trigger on correct spelling of ROLLBAR_ENV, 'prod'
  • Loading branch information
dragon-dxw authored Dec 15, 2022
2 parents d7d2204 + 9dcd7b2 commit d86aa76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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 @@ -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(
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions ds-caselaw-ingester/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_store_file_file_no_credentials(self, mock_print):
"EDITORIAL_UI_BASE_URL": "http://editor.url/",
"NOTIFY_EDITORIAL_ADDRESS": "[email protected]",
"NOTIFY_NEW_JUDGMENT_TEMPLATE_ID": "template-id",
"ROLLBAR_ENV": "production",
"ROLLBAR_ENV": "prod",
},
clear=True,
)
Expand Down Expand Up @@ -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": "[email protected]",
"NOTIFY_UPDATED_JUDGMENT_TEMPLATE_ID": "template-id",
"ROLLBAR_ENV": "production",
"ROLLBAR_ENV": "prod",
},
clear=True,
)
Expand Down

0 comments on commit d86aa76

Please sign in to comment.