- Added logging to indicate that we created the notification and that we sent the notification to a delivery queue.

- Small updates as recommended by review comments.
This commit is contained in:
Rebecca Law
2017-01-18 09:56:26 +00:00
parent 41b49eb8e0
commit f66670c558
6 changed files with 28 additions and 21 deletions

View File

@@ -43,6 +43,7 @@ def persist_notification(template_id,
reference=None,
notification_id=None,
simulated=False):
# if simulated create a Notification model to return but do not persist the Notification to the dB
notification = Notification(
id=notification_id,
template_id=template_id,
@@ -62,6 +63,9 @@ def persist_notification(template_id,
if not simulated:
dao_create_notification(notification)
redis_store.incr(redis.daily_limit_cache_key(service.id))
current_app.logger.info(
"{} {} created at {}".format(notification.notification_type, notification.id, notification.created_at)
)
return notification
@@ -87,8 +91,9 @@ def send_notification_to_queue(notification, research_mode, queue=None):
raise SendNotificationToQueueError()
current_app.logger.info(
"{} {} created at {}".format(notification.notification_type, notification.id, notification.created_at)
)
"{} {} sent to the {} queue for delivery".format(notification.notification_type,
notification.id,
queue))
def simulated_recipient(to_address, notification_type):