Reorder updates to the notification / stats tables to match create.

This commit is contained in:
Martyn Inglis
2016-05-31 10:17:15 +01:00
parent a7a669a7c2
commit 2108bb52d5
4 changed files with 45 additions and 42 deletions

View File

@@ -54,10 +54,9 @@ def process_sms_client_response(status, reference, client_name):
notification_success = response_dict['success']
# record stats
update_success = notifications_dao.update_notification_status_by_id(reference,
notification_status,
notification_statistics_status)
if update_success == 0:
if not notifications_dao.update_notification_status_by_id(reference,
notification_status,
notification_statistics_status):
status_error = "{} callback failed: notification {} either not found or already updated " \
"from sending. Status {}".format(client_name,
reference,