Fix for simulated notifications.

When a post is made for a simulated number the id is empty in the notificaiton object that we return.
This fixes that.
This commit is contained in:
Rebecca Law
2017-07-20 17:56:51 +01:00
parent 49bbd1a29b
commit d4bbca2592
2 changed files with 4 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import uuid
from datetime import datetime
from flask import current_app
@@ -53,7 +54,8 @@ def persist_notification(
created_by_id=None
):
notification_created_at = created_at or datetime.utcnow()
if not notification_id and simulated:
notification_id = uuid.uuid4()
notification = Notification(
id=notification_id,
template_id=template_id,