diff --git a/app/config.py b/app/config.py index ad8951baf..cd694be4b 100644 --- a/app/config.py +++ b/app/config.py @@ -72,6 +72,8 @@ class Config(object): ACTIVITY_STATS_LIMIT_DAYS = 7 TEST_MESSAGE_FILENAME = 'Report' + REPLY_TO_EMAIL_ADDRESS_VALIDATION_TIMEOUT = 45 + NOTIFY_ENVIRONMENT = 'development' LOGO_UPLOAD_BUCKET_NAME = 'public-logos-local' MOU_BUCKET_NAME = 'local-mou' @@ -147,6 +149,9 @@ class Preview(Config): ASSET_DOMAIN = 'static.notify.works' ASSET_PATH = 'https://static.notify.works/' + # On preview, extend the validation timeout to allow more leniency when running functional tests + REPLY_TO_EMAIL_ADDRESS_VALIDATION_TIMEOUT = 120 + class Staging(Config): SHOW_STYLEGUIDE = False diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 8596a431c..79447ebe5 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -478,7 +478,8 @@ def get_service_verify_reply_to_address_partials(service_id, notification_id): created_at_no_tz = notification["created_at"][:-6] seconds_since_sending = (datetime.utcnow() - datetime.strptime(created_at_no_tz, '%Y-%m-%dT%H:%M:%S.%f')).seconds if notification["status"] in FAILURE_STATUSES or ( - notification["status"] in SENDING_STATUSES and seconds_since_sending > 45 + notification["status"] in SENDING_STATUSES and + seconds_since_sending > current_app.config['REPLY_TO_EMAIL_ADDRESS_VALIDATION_TIMEOUT'] ): verification_status = "failure" form.email_address.data = notification['to']