Tidied up pull request comments

This commit is contained in:
Martyn Inglis
2016-09-23 15:59:23 +01:00
parent 124487f204
commit 6f7dd149e2
4 changed files with 10 additions and 14 deletions

View File

@@ -75,12 +75,12 @@ class FiretextClient(SmsClient):
response.status_code response.status_code
) )
if not success: if success:
self.statsd_client.incr("clients.firetext.error")
self.current_app.logger.error(log_message)
else:
self.current_app.logger.info(log_message) self.current_app.logger.info(log_message)
self.statsd_client.incr("clients.firetext.success") self.statsd_client.incr("clients.firetext.success")
else:
self.statsd_client.incr("clients.firetext.error")
self.current_app.logger.error(log_message)
def send_sms(self, to, content, reference, sender=None): def send_sms(self, to, content, reference, sender=None):

View File

@@ -75,12 +75,12 @@ class MMGClient(SmsClient):
response.status_code response.status_code
) )
if not success: if success:
self.statsd_client.incr("clients.mmg.error")
self.current_app.logger.error(log_message)
else:
self.current_app.logger.info(log_message) self.current_app.logger.info(log_message)
self.statsd_client.incr("clients.mmg.success") self.statsd_client.incr("clients.mmg.success")
else:
self.statsd_client.incr("clients.mmg.error")
self.current_app.logger.error(log_message)
def get_name(self): def get_name(self):
return self.name return self.name

View File

@@ -8,10 +8,7 @@ from notifications_utils.template import Template, get_sms_fragment_count
from notifications_utils.renderers import HTMLEmail, PlainTextEmail, SMSMessage from notifications_utils.renderers import HTMLEmail, PlainTextEmail, SMSMessage
from app import clients, statsd_client, create_uuid from app import clients, statsd_client, create_uuid
from app.dao.notifications_dao import ( from app.dao.notifications_dao import dao_update_notification
get_notification_by_id,
dao_update_notification
)
from app.dao.provider_details_dao import get_provider_details_by_notification_type from app.dao.provider_details_dao import get_provider_details_by_notification_type
from app.dao.services_dao import dao_fetch_service_by_id from app.dao.services_dao import dao_fetch_service_by_id
from app.celery.research_mode_tasks import send_sms_response, send_email_response from app.celery.research_mode_tasks import send_sms_response, send_email_response

View File

@@ -2,10 +2,9 @@ import uuid
from datetime import datetime from datetime import datetime
import pytest import pytest
from mock import ANY from unittest.mock import ANY
import app import app
from sqlalchemy.orm.exc import NoResultFound
from app import mmg_client from app import mmg_client
from app.dao import (provider_details_dao, notifications_dao) from app.dao import (provider_details_dao, notifications_dao)
from app.delivery import send_to_providers from app.delivery import send_to_providers