Remove irrelevant stuff from error check pages

If you have errors in your file then there’s stuff you’re not going to
see on the page. So this doesn’t need to be in the Jinja templates that
are only used when there are errors.

Basically the conditional stuff is moving up to the level above these
templates.
This commit is contained in:
Chris Hill-Scott
2017-07-20 09:10:23 +01:00
parent 5a9f817e52
commit 94bc8191ae
3 changed files with 32 additions and 206 deletions

View File

@@ -450,6 +450,14 @@ def check_messages(service_id, template_type, upload_id):
data = _check_messages(service_id, template_type, upload_id)
if (
data['recipients'].too_many_rows or
not data['count_of_recipients'] or
not data['recipients'].has_recipient_columns or
data['recipients'].missing_column_headers
):
return render_template('views/check/column-errors.html', **data)
if data['row_errors']:
return render_template('views/check/row-errors.html', **data)