From 021625abb3c676e9794fd6107024ee038f9c0a57 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Fri, 28 Dec 2018 14:29:59 +0000 Subject: [PATCH] make sure log line works if notification still in created --- app/dao/notifications_dao.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index d683cb636..c78582851 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -185,8 +185,7 @@ def update_notification_status_by_reference(reference, status): if notification.status not in { NOTIFICATION_SENDING, - NOTIFICATION_PENDING, - NOTIFICATION_SENT, + NOTIFICATION_PENDING }: _duplicate_update_warning(notification, status) return None @@ -714,7 +713,7 @@ def _duplicate_update_warning(notification, status): id=notification.id, old_status=notification.status, new_status=status, - time_diff=datetime.utcnow() - notification.sent_at, + time_diff=datetime.utcnow() - (notification.updated_at or notification.created_at), type=notification.notification_type, sent_by=notification.sent_by )