mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Remove redundant ternary on SMS client FROM_NUMBER
Logs over the past 14 days confirm we never call this code with None as the sender, so it's safe to remove the ternary.
This commit is contained in:
@@ -23,7 +23,6 @@ class SmsClient(Client):
|
||||
def init_app(self, current_app, statsd_client):
|
||||
self.current_app = current_app
|
||||
self.statsd_client = statsd_client
|
||||
self.from_number = self.current_app.config.get('FROM_NUMBER')
|
||||
|
||||
def record_outcome(self, success):
|
||||
log_message = "Provider request for {} {}".format(
|
||||
@@ -41,15 +40,6 @@ 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:
|
||||
response = self.try_send_sms(to, content, reference, international, sender)
|
||||
self.record_outcome(True)
|
||||
|
||||
Reference in New Issue
Block a user