The send_sms task will created the notification with a status = created.

The encrypted_notification for the send_sms_to_provider task has been made optional.
This commit is contained in:
Rebecca Law
2016-06-22 13:32:27 +01:00
parent 3d3bff25a8
commit fcb5ca9ef4
5 changed files with 83 additions and 288 deletions

View File

@@ -55,12 +55,9 @@ def send_sms_to_provider(self, service_id, notification_id, encrypted_notificati
provider = provider_to_use('sms', notification_id)
notification = get_notification_by_id(notification_id)
# notification_json = encryption.decrypt(encrypted_notification)
template = Template(
dao_get_template_by_id(notification.template_id, notification.template_version).__dict__,
values=notification.personalisation['personalisation'] if notification.personalisation[
'personalisation'] else {},
values={} if not notification.personalisation else notification.personalisation,
prefix=service.name
)
try:

View File

@@ -247,9 +247,7 @@ def _update_notification_status(notification, status, notification_statistics_st
@transactional
def update_notification_status_by_id(notification_id, status, notification_statistics_status=None):
notification = Notification.query.filter(
Notification.id == notification_id,
or_(Notification.status == 'sending',
Notification.status == 'pending')).first()
Notification.id == notification_id).first()
if not notification:
return False