From 8b7a0b88cbdbadc3e94a0048c9e341f7261af598 Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Wed, 3 Jun 2020 12:34:04 +0100 Subject: [PATCH] Ensure that aws ses stub client is not run in production --- app/__init__.py | 4 ++-- app/config.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 4673a0ce3..b33c78034 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -88,10 +88,10 @@ def create_app(application): aws_ses_stub_client.init_app( application.config['AWS_REGION'], statsd_client=statsd_client, - stub_url=os.environ.get('SES_STUB_URL') + stub_url=application.config['SES_STUB_URL'] ) # If a stub url is provided for SES, then use the stub client rather than the real SES boto client - email_clients = [aws_ses_client] if not os.environ.get('SES_STUB_URL') else [aws_ses_stub_client] + email_clients = [aws_ses_stub_client] if application.config['SES_STUB_URL'] else [aws_ses_client] clients.init_app(sms_clients=[firetext_client, mmg_client], email_clients=email_clients) notify_celery.init_app(application) diff --git a/app/config.py b/app/config.py index e55933956..a7aff994a 100644 --- a/app/config.py +++ b/app/config.py @@ -486,6 +486,7 @@ class Live(Config): PERFORMANCE_PLATFORM_ENABLED = True API_RATE_LIMIT_ENABLED = True CHECK_PROXY_HEADER = True + SES_STUB_URL = None CRONITOR_ENABLED = True