Ensure that aws ses stub client is not run in production

This commit is contained in:
Pea Tyczynska
2020-06-03 12:34:04 +01:00
committed by David McDonald
parent 6422a88c8c
commit 8b7a0b88cb
2 changed files with 3 additions and 2 deletions

View File

@@ -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)