Merge branch 'master' into use-reply-to-in-send-to-provider

This commit is contained in:
Rebecca Law
2017-11-29 14:34:28 +00:00
45 changed files with 182 additions and 172 deletions

View File

@@ -1,15 +1,14 @@
from flask import Blueprint, jsonify
from flask import Blueprint, jsonify, current_app
from app.config import QueueNames
from app.delivery import send_to_providers
from app.models import EMAIL_TYPE
from app.celery import provider_tasks
from app.dao import notifications_dao
from flask import current_app
from app.errors import register_errors
delivery_blueprint = Blueprint('delivery', __name__)
from app.errors import register_errors
register_errors(delivery_blueprint)

View File

@@ -7,6 +7,7 @@ from notifications_utils.recipients import (
validate_and_format_email_address
)
from notifications_utils.template import HTMLEmailTemplate, PlainTextEmailTemplate, SMSMessageTemplate
from requests.exceptions import HTTPError
from app import clients, statsd_client, create_uuid
from app.dao.notifications_dao import (
@@ -60,7 +61,7 @@ def send_sms_to_provider(notification):
update_notification(notification, provider)
try:
send_sms_response(provider.get_name(), str(notification.id), notification.to)
except:
except HTTPError:
# when we retry, we only do anything if the notification is in created - it's currently in sending,
# so set it back so that we actually attempt the callback again
notification.sent_at = None