From cf8be03c5e4ed3c234e9a46727554775309cbde5 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Fri, 2 Feb 2018 11:27:58 +0000 Subject: [PATCH] Fix bug with sending deskpro tickets in production. The NOTIFY_ENVIRONMENT variable is set to `production` from the run_paas_app script, but that is overwritten with `live` in the create_app function when starting an application. Although this is confusing and it would be good to resolve that. It is a larger piece of work. For now I have included booth strings in the if condition, that way when we do migrate the code we will not have an issue with these two methods. --- app/celery/scheduled_tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/celery/scheduled_tasks.py b/app/celery/scheduled_tasks.py index b461a7299..579927b83 100644 --- a/app/celery/scheduled_tasks.py +++ b/app/celery/scheduled_tasks.py @@ -364,7 +364,7 @@ def raise_alert_if_letter_notifications_still_sending(): ) # Only send alerts in production - if current_app.config['NOTIFY_ENVIRONMENT'] in ['production', 'test']: + if current_app.config['NOTIFY_ENVIRONMENT'] in ['live', 'production', 'test']: deskpro_client.create_ticket( subject="[{}] Letters still sending".format(current_app.config['NOTIFY_ENVIRONMENT']), message=message, @@ -535,7 +535,7 @@ def letter_raise_alert_if_no_ack_file_for_zip(): zip_file_set.discard('') if len(zip_file_set - ack_content_set) > 0: - if current_app.config['NOTIFY_ENVIRONMENT'] in ['production', 'test']: + if current_app.config['NOTIFY_ENVIRONMENT'] in ['live', 'production', 'test']: deskpro_client.create_ticket( subject="Letter acknowledge error", message=deskpro_message,