code review feedback

This commit is contained in:
Kenneth Kehl
2024-08-20 10:29:19 -07:00
parent e0404977c0
commit 5c3b96123a
2 changed files with 2 additions and 2 deletions

View File

@@ -49,7 +49,6 @@ class AwsSnsClient(SmsClient):
def send_sms(self, to, content, reference, sender=None, international=False): def send_sms(self, to, content, reference, sender=None, international=False):
matched = False matched = False
print(hilite(f"TO {to}"))
for match in phonenumbers.PhoneNumberMatcher(to, "US"): for match in phonenumbers.PhoneNumberMatcher(to, "US"):
matched = True matched = True
to = phonenumbers.format_number( to = phonenumbers.format_number(

View File

@@ -1,4 +1,5 @@
import json import json
from contextlib import suppress
from urllib import parse from urllib import parse
from cachetools import TTLCache, cached from cachetools import TTLCache, cached
@@ -129,7 +130,7 @@ def send_sms_to_provider(notification):
def _get_verify_code(notification): def _get_verify_code(notification):
key = f"2facode-{notification.id}".replace(" ", "") key = f"2facode-{notification.id}".replace(" ", "")
recipient = redis_store.get(key) recipient = redis_store.get(key)
if recipient: with suppress(AttributeError):
recipient = recipient.decode("utf-8") recipient = recipient.decode("utf-8")
return recipient return recipient