Ensure that the primary provider is used in all tasks

This commit is contained in:
Martyn Inglis
2016-05-10 09:04:22 +01:00
parent 4f38039e09
commit 571686b638
14 changed files with 203 additions and 77 deletions

View File

@@ -28,8 +28,17 @@ class Clients(object):
for client in email_clients:
self.email_clients[client.name] = client
def sms_client(self, name):
def get_sms_client(self, name):
return self.sms_clients.get(name)
def email_client(self, name):
def get_email_client(self, name):
return self.email_clients.get(name)
def get_client_by_name_and_type(self, name, notification_type):
assert notification_type in ['email', 'sms']
if notification_type == 'email':
return self.get_email_client(name)
if notification_type == 'sms':
return self.get_sms_client(name)