Merge branch 'master' into schedule-api-notification

Conflicts:
	app/celery/scheduled_tasks.py
	app/v2/notifications/post_notifications.py
	tests/app/celery/test_scheduled_tasks.py
This commit is contained in:
Rebecca Law
2017-05-22 14:05:57 +01:00
48 changed files with 1917 additions and 291 deletions

View File

@@ -48,6 +48,9 @@ def persist_notification(
notification_id=None,
simulated=False
):
notification_created_at = created_at or datetime.utcnow()
notification = Notification(
id=notification_id,
template_id=template_id,
@@ -59,7 +62,7 @@ def persist_notification(
notification_type=notification_type,
api_key_id=api_key_id,
key_type=key_type,
created_at=created_at or datetime.utcnow(),
created_at=notification_created_at,
job_id=job_id,
job_row_number=job_row_number,
client_reference=client_reference,
@@ -82,7 +85,7 @@ def persist_notification(
if redis_store.get_all_from_hash(cache_key_for_service_template_counter(service.id)):
redis_store.increment_hash_value(cache_key_for_service_template_counter(service.id), template_id)
current_app.logger.info(
"{} {} created at {}".format(notification.notification_type, notification.id, notification.created_at)
"{} {} created at {}".format(notification_type, notification_id, notification_created_at)
)
return notification