mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Use the template version at the time the notification is created or at the time the job is created.
Update notifications/sms|email endpoint to send the template version to the queue. Update the process_job celery talk to send the template version to the queue. When the send_sms|send_email task runs it will get the template by id and version. Created a data migration script to add the template_vesion column for jobs and notifications. The existing jobs and notifications are given the template_version of the current template. There is a chance this is the wrong template version, but deemed okay since the application is not live. Create unit test for the dao_get_template_versions method. Rename /template/<id>/version to /template/<id>/versions which returns all versions for that template id and service id.
This commit is contained in:
@@ -237,13 +237,12 @@ def sample_job(notify_db,
|
||||
if template is None:
|
||||
template = sample_template(notify_db, notify_db_session,
|
||||
service=service)
|
||||
job_id = uuid.uuid4()
|
||||
data = {
|
||||
'id': uuid.uuid4(),
|
||||
'service_id': service.id,
|
||||
'service': service,
|
||||
'template_id': template.id,
|
||||
'template_version': 1,
|
||||
'template_version': template.version,
|
||||
'original_file_name': 'some.csv',
|
||||
'notification_count': notification_count,
|
||||
'created_at': created_at,
|
||||
@@ -286,6 +285,7 @@ def sample_email_job(notify_db,
|
||||
'service_id': service.id,
|
||||
'service': service,
|
||||
'template_id': template.id,
|
||||
'template_version': template.version,
|
||||
'original_file_name': 'some.csv',
|
||||
'notification_count': 1,
|
||||
'created_by': service.created_by
|
||||
|
||||
Reference in New Issue
Block a user