mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 17:52:26 -05:00
In the effort to reduce the number of database connections I introduced a small bug. This only affected the test templated letter flow, a None type error would happen when trying to creathe completed_at timestamp for a delivered message.
In the previous PR I removed the `update_notification` method to reduce the need for another update query. However, that meant the notification was marked as delivered without an updated_at timestamp. It is weird to set the updated_at when we create the notification. So is this a better fix? Or do I put the update back now? I recommend we push this fix now.
This commit is contained in:
@@ -79,7 +79,8 @@ def persist_notification(
|
||||
billable_units=None,
|
||||
postage=None,
|
||||
template_postage=None,
|
||||
document_download_count=None
|
||||
document_download_count=None,
|
||||
updated_at=None
|
||||
):
|
||||
notification_created_at = created_at or datetime.utcnow()
|
||||
if not notification_id:
|
||||
@@ -105,6 +106,7 @@ def persist_notification(
|
||||
reply_to_text=reply_to_text,
|
||||
billable_units=billable_units,
|
||||
document_download_count=document_download_count,
|
||||
updated_at=updated_at
|
||||
)
|
||||
|
||||
if notification_type == SMS_TYPE:
|
||||
|
||||
Reference in New Issue
Block a user