mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
code review feedback
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user