From 71417a19dcc398dd2fe91ff7056399f9699c31d1 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 25 Sep 2024 10:22:27 -0700 Subject: [PATCH] fix load test --- app/delivery/send_to_providers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 2e28777c6..fbea9a2f7 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -1,4 +1,5 @@ import json +import os from contextlib import suppress from urllib import parse @@ -104,7 +105,9 @@ def send_sms_to_provider(notification): recipient_lookup = f"+{recipient}" else: recipient_lookup = recipient - if recipient_lookup in current_app.config["SIMULATED_SMS_NUMBERS"]: + if recipient_lookup in current_app.config[ + "SIMULATED_SMS_NUMBERS" + ] and os.getenv("NOTIFY_ENVIRONMENT") in ["development", "test"]: current_app.logger.info(hilite("#validate-phone-number fired")) aws_pinpoint_client.validate_phone_number("01", recipient) else: