Ensures that both the CSV processing and the API both use the new deliver_email and deliver_sms tasks not the old ones with the redundant parameter.

This commit is contained in:
Martyn Inglis
2016-09-28 15:05:50 +01:00
parent 9233ffa3d4
commit c13ead77e4
5 changed files with 106 additions and 115 deletions

View File

@@ -46,7 +46,7 @@ from app.errors import (
)
register_errors(notifications)
from app.celery.provider_tasks import send_sms_to_provider, send_email_to_provider
from app.celery import provider_tasks
@notifications.route('/notifications/email/ses', methods=['POST'])
@@ -342,9 +342,9 @@ def persist_notification(
try:
if notification_type == SMS_TYPE:
send_sms_to_provider.apply_async((str(service.id), str(notification_id)), queue='send-sms')
provider_tasks.deliver_sms.apply_async((str(notification_id)), queue='send-sms')
if notification_type == EMAIL_TYPE:
send_email_to_provider.apply_async((str(service.id), str(notification_id)), queue='send-email')
provider_tasks.deliver_email.apply_async((str(notification_id)), queue='send-email')
except Exception as e:
current_app.logger.exception("Failed to send to SQS exception", e)
dao_delete_notifications_and_history_by_id(notification_id)