Removed logging, and make fire text only client.

This commit is contained in:
Martyn Inglis
2016-02-17 13:59:01 +00:00
parent 226459132a
commit 837c9b7cdb
3 changed files with 11 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
from app import notify_celery, twilio_client, encryption, firetext_client
from app.clients.sms.twilio import TwilioClientException
from app import notify_celery, encryption, firetext_client
from app.clients.sms.firetext import FiretextClientException
from app.dao.templates_dao import get_model_templates
from app.dao.notifications_dao import save_notification
from app.models import Notification
@@ -23,9 +23,8 @@ def send_sms(service_id, notification_id, encrypted_notification):
save_notification(notification_db_object)
try:
twilio_client.send_sms(notification['to'], template.content)
firetext_client.send_sms(notification['to'], template.content)
except TwilioClientException as e:
except FiretextClientException as e:
current_app.logger.debug(e)
save_notification(notification_db_object, {"status": "failed"})

View File

@@ -19,7 +19,6 @@ class FiretextClient(SmsClient):
def init_app(self, config, *args, **kwargs):
super(SmsClient, self).__init__(*args, **kwargs)
print(config.config)
self.api_key = config.config.get('FIRETEXT_API_KEY')
self.from_number = config.config.get('FIRETEXT_NUMBER')
@@ -32,8 +31,6 @@ class FiretextClient(SmsClient):
"message": content
}
print(data)
try:
response = request(
"POST",