From f57b5445c3514bc696bb925425aa2ffb6cb06428 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 28 Feb 2020 09:58:13 +0000 Subject: [PATCH] Pass through template_type from DAO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DAO sets template type to `None` for one-off letters, so the REST method doesn’t need to do any special handling of it. --- app/upload/rest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/upload/rest.py b/app/upload/rest.py index b06aeeb1d..e0358ca77 100644 --- a/app/upload/rest.py +++ b/app/upload/rest.py @@ -44,7 +44,7 @@ def get_paginated_uploads(service_id, limit_days, page): '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, - 'template_type': None, + 'template_type': upload.template_type, 'recipient': upload.recipient, } if upload.upload_type == 'job': @@ -60,7 +60,6 @@ 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)