From 1f4b408d1d2028c076948c9b6b772f73eb5476fc Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 15 Apr 2025 11:13:26 -0700 Subject: [PATCH] fix phone number check --- app/delivery/send_to_providers.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 1ae1db7b5..0158a47df 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -105,11 +105,13 @@ def send_sms_to_provider(notification): # The future home of the validation is TBD _experimentally_validate_phone_numbers(recipient) - # We need to handle the case where people ignored the "1" country code for US - # East Timor (670) has ten digit numbers including code so requires special handling + # TODO current we allow US phone numbers to be uploaded without the country code (1) + # This will break certain international phone numbers (Norway, Denmark, East Timor) + # When we officially announce support for international numbers, US numbers must contain + # their country code. recipient = str(recipient) - if len(recipient) == 10 and not recipient.startswith("670"): - if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]: + if len(recipient) == 10: + if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]: # we want to test intl support recipient = f"1{recipient}" sender_numbers = get_sender_numbers(notification)