From 628c6eb84820f83b928aed12086f2d3c47f7cf3f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 6 Jan 2025 11:45:31 -0800 Subject: [PATCH] do minimalistic fix first --- app/delivery/send_to_providers.py | 2 +- app/models.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 74be6429c..e41062b41 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -158,7 +158,7 @@ def _get_verify_code(notification): recipient = recipient.decode("utf-8") return recipient -# PUT THE FIX HERE??????? + def get_sender_numbers(notification): possible_senders = dao_get_sms_senders_by_service_id(notification.service_id) sender_numbers = [] diff --git a/app/models.py b/app/models.py index ec6eac335..fc7b855e4 100644 --- a/app/models.py +++ b/app/models.py @@ -577,7 +577,16 @@ def get_inbound_number(self): return self.inbound_number.number def get_default_sms_sender(self): - default_sms_sender = [x for x in self.service_sms_senders if x.is_default] + # notify-api-1513 let's try a minimalistic fix + # to see if we can get the right numbers back + default_sms_sender = [ + x + for x in self.service_sms_senders + if x.is_default and x.service_id == self.id + ] + current_app.logger.info( + f"#notify-api-1513 senders for service {self.name} are {self.service_sms_senders}" + ) return default_sms_sender[0].sms_sender def get_default_reply_to_email_address(self):