mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Add notification_type to notification table.
It seems like an oversight not to include the notification type in the notifcation. When updating statistics a query to the template table is required to get the type, this update will mean that query does not have to happen.
This commit is contained in:
@@ -46,6 +46,7 @@ def _notification_json(template, to, personalisation=None, job_id=None, row_numb
|
||||
"template": str(template.id),
|
||||
"template_version": template.version,
|
||||
"to": to,
|
||||
"notification_type": template.template_type
|
||||
}
|
||||
if personalisation:
|
||||
notification.update({"personalisation": personalisation})
|
||||
|
||||
@@ -351,7 +351,8 @@ def sample_notification(notify_db,
|
||||
'reference': reference,
|
||||
'created_at': created_at,
|
||||
'content_char_count': content_char_count,
|
||||
'personalisation': personalisation
|
||||
'personalisation': personalisation,
|
||||
'notification_type': template.template_type
|
||||
}
|
||||
if job_row_number:
|
||||
data['job_row_number'] = job_row_number
|
||||
|
||||
@@ -976,6 +976,7 @@ def _notification_json(sample_template, job_id=None, id=None, status=None):
|
||||
'template_version': sample_template.version,
|
||||
'created_at': datetime.utcnow(),
|
||||
'content_char_count': 160,
|
||||
'notification_type': sample_template.template_type
|
||||
}
|
||||
if job_id:
|
||||
data.update({'job_id': job_id})
|
||||
|
||||
Reference in New Issue
Block a user