Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels committed May 8, 2024
1 parent 6e7de9f commit ea7f071
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/clients/sms/aws_pinpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import phonenumbers

from app.clients.sms import SmsClient

from app.config import Config


class AwsPinpointClient(SmsClient):
"""
AWS Pinpoint SMS client
Expand All @@ -31,7 +31,7 @@ def send_sms(self, to, content, reference, multi=True, sender=None, template_id=
pool_id = Config.AWS_PINPOINT_SC_POOL_ID
else:
pool_id = Config.AWS_PINPOINT_DEFAULT_POOL_ID

for match in phonenumbers.PhoneNumberMatcher(to, "US"):
matched = True
to = phonenumbers.format_number(match.number, phonenumbers.PhoneNumberFormat.E164)
Expand Down
7 changes: 2 additions & 5 deletions app/delivery/send_to_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,16 @@ def update_notification_to_sending(notification, provider):


def provider_to_use(notification_type, notification_id, international=False, sender=None, template_id=None):

# TODO: remove the first option once we have pinpoint fully integrated
if Config.AWS_PINPOINT_SC_POOL_ID is None or Config.AWS_PINPOINT_DEFAULT_POOL_ID is None:
active_providers_in_order = [
p
for p in get_provider_details_by_notification_type(notification_type, international)
if p.active and p.identifier != PINPOINT_PROVIDER
]
else:
else:
active_providers_in_order = [
p
for p in get_provider_details_by_notification_type(notification_type, international)
if p.active
p for p in get_provider_details_by_notification_type(notification_type, international) if p.active
]

if not active_providers_in_order:
Expand Down

0 comments on commit ea7f071

Please sign in to comment.