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:
Rebecca Law
2020-06-18 08:30:19 +01:00
parent 3f117282af
commit be7afdd12b
4 changed files with 14 additions and 4 deletions

View File

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