make sure log line works if notification still in created

This commit is contained in:
Leo Hemsted
2018-12-28 14:29:59 +00:00
parent 2355ee011f
commit 021625abb3

View File

@@ -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
)