Remove redundant call to get_template

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.
This commit is contained in:
Chris Hill-Scott
2018-04-30 10:04:06 +01:00
parent 66e6538d95
commit 735d5f0a29

View File

@@ -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