restore international numbers

This commit is contained in:
Kenneth Kehl
2025-04-03 08:02:08 -07:00
parent 555b10d793
commit e9ea22ad6d
5 changed files with 89 additions and 84 deletions

View File

@@ -48,7 +48,9 @@ class AwsSnsClient(SmsClient):
def send_sms(self, to, content, reference, sender=None, international=False):
matched = False
for match in phonenumbers.PhoneNumberMatcher(to, "US"):
if "+" not in to:
to = f"+{to}"
for match in phonenumbers.PhoneNumberMatcher(to, None):
matched = True
to = phonenumbers.format_number(
match.number, phonenumbers.PhoneNumberFormat.E164

View File

@@ -629,7 +629,8 @@ def dao_fetch_stats_for_service_from_days_for_user(
).group_by(total_substmt.c.hour)
total_notifications = {
row.hour: row.total_notifications for row in db.session.execute(total_stmt).all()
row.hour: row.total_notifications
for row in db.session.execute(total_stmt).all()
}
stmt = (