Return template type in uploads response

We need template type for the uploads response, which will eventually
supercede the jobs response. At the moment the page uses both.
This commit is contained in:
Chris Hill-Scott
2020-02-25 17:13:01 +00:00
parent 8601b13595
commit 57e671267c
4 changed files with 36 additions and 5 deletions

View File

@@ -43,7 +43,8 @@ def get_paginated_uploads(service_id, limit_days, page):
'notification_count': upload.notification_count,
'created_at': upload.scheduled_for.strftime(
"%Y-%m-%d %H:%M:%S") if upload.scheduled_for else upload.created_at.strftime("%Y-%m-%d %H:%M:%S"),
'upload_type': upload.upload_type
'upload_type': upload.upload_type,
'template_type': None,
}
if upload.upload_type == 'job':
start = upload.processing_started
@@ -58,6 +59,7 @@ def get_paginated_uploads(service_id, limit_days, page):
statistics = dao_get_notification_outcomes_for_job(service_id, upload.id)
upload_dict['statistics'] = [{'status': statistic.status, 'count': statistic.count} for statistic in
statistics]
upload_dict['template_type'] = upload.template_type
else:
upload_dict['statistics'] = [{'status': upload.status, 'count': 1}]
data.append(upload_dict)