From e6fffc00da22fc5dcdb44d04e910a4ebc62222ce Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Wed, 30 Mar 2022 13:36:10 +0100 Subject: [PATCH] Add temporary log to check if code is in use In response to: [^1]. [^1]: https://github.com/alphagov/notifications-api/pull/3493#discussion_r838477599 --- app/clients/sms/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/clients/sms/__init__.py b/app/clients/sms/__init__.py index 0aca5b58c..38f3c55c9 100644 --- a/app/clients/sms/__init__.py +++ b/app/clients/sms/__init__.py @@ -40,6 +40,14 @@ class SmsClient(Client): def send_sms(self, to, content, reference, international, sender): start_time = monotonic() + + if sender is None: + # temporary log to see if the following ternary is necessary + # or if it's safe to remove it - keep for 1-2 weeks + self.current_app.logger.warning( + f"send_sms called with 'sender' of 'None' for {reference}" + ) + sender = self.from_number if sender is None else sender try: