From 735d5f0a295eaf3844e5b1334a7116a82293d01b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 30 Apr 2018 10:04:06 +0100 Subject: [PATCH] Remove redundant call to get_template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re getting the template just to get back its `id`, which is the one thing we do know in order to get it. The call to get template is still happening inside `_check_messages`, so we’ll still catch someone trying to look at this page for a template that doesn’t exist. --- app/main/views/send.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index 1e01370e0..76faba72f 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -589,9 +589,8 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_ @login_required @user_has_permissions('send_messages', restrict_admin_usage=True) def check_messages(service_id, template_id, upload_id, row_index=2): - db_template = service_api_client.get_service_template(service_id, template_id)['data'] - data = _check_messages(service_id, db_template['id'], upload_id, row_index) + data = _check_messages(service_id, template_id, upload_id, row_index) if ( data['recipients'].too_many_rows or