mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Merge branch 'main' into stvnrlly-remove-broadcasts
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
from celery import current_app
|
||||
|
||||
|
||||
class ClientException(Exception):
|
||||
'''
|
||||
Base Exceptions for sending notifications that fail
|
||||
@@ -38,7 +35,7 @@ class NotificationProviderClients(object):
|
||||
return self.email_clients.get(name)
|
||||
|
||||
def get_client_by_name_and_type(self, name, notification_type):
|
||||
assert notification_type in ['email', 'sms'] # nosec B101
|
||||
assert notification_type in ['email', 'sms'] # nosec B101
|
||||
|
||||
if notification_type == 'email':
|
||||
return self.get_email_client(name)
|
||||
|
||||
@@ -25,4 +25,4 @@ class SmsClient(Client):
|
||||
raise NotImplementedError("TODO Need to implement.")
|
||||
|
||||
def get_name(self):
|
||||
raise NotImplementedError("TODO Need to implement.")
|
||||
raise NotImplementedError("TODO Need to implement.")
|
||||
|
||||
@@ -20,7 +20,7 @@ class AwsSnsClient(SmsClient):
|
||||
self.current_app = current_app
|
||||
self.statsd_client = statsd_client
|
||||
self.long_code_regex = re.compile(r"^\+1\d{10}$")
|
||||
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return 'sns'
|
||||
@@ -86,4 +86,4 @@ class AwsSnsClient(SmsClient):
|
||||
raise ValueError("No valid numbers found for SMS delivery")
|
||||
|
||||
def _send_with_dedicated_phone_number(self, sender):
|
||||
return sender and re.match(self.long_code_regex, sender)
|
||||
return sender and re.match(self.long_code_regex, sender)
|
||||
|
||||
Reference in New Issue
Block a user