mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-17 18:52:30 -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:
@@ -157,7 +157,8 @@ def send_sms(self, service_id, notification_id, encrypted_notification, created_
|
||||
job_row_number=notification.get('row_number', None),
|
||||
status='created',
|
||||
created_at=datetime.strptime(created_at, DATETIME_FORMAT),
|
||||
personalisation=notification.get('personalisation')
|
||||
personalisation=notification.get('personalisation'),
|
||||
notification_type='sms'
|
||||
)
|
||||
dao_create_notification(notification_db_object, TEMPLATE_TYPE_SMS)
|
||||
|
||||
@@ -202,7 +203,8 @@ def send_email(service_id, notification_id, encrypted_notification, created_at,
|
||||
created_at=datetime.strptime(created_at, DATETIME_FORMAT),
|
||||
sent_at=sent_at,
|
||||
sent_by=provider.get_name(),
|
||||
personalisation=notification.get('personalisation')
|
||||
personalisation=notification.get('personalisation'),
|
||||
notification_type='email'
|
||||
)
|
||||
|
||||
dao_create_notification(notification_db_object, TEMPLATE_TYPE_EMAIL)
|
||||
|
||||
Reference in New Issue
Block a user