Refactor page_count checks to avoid magic numbers

This commit is contained in:
Pea Tyczynska
2019-10-01 16:03:35 +01:00
parent 028d156dc7
commit b42c7c4c9f
7 changed files with 18 additions and 6 deletions

View File

@@ -591,7 +591,8 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_
sent_previously=job_api_client.has_sent_previously(
service_id, template.id, db_template['version'], request.args.get('original_file_name', '')
),
page_count=page_count
page_count=page_count,
letter_max_pages=current_app.config['LETTER_MAX_PAGES'],
)
@@ -885,6 +886,7 @@ def _check_notification(service_id, template_id, exception=None):
back_link=back_link,
help=get_help_argument(),
page_count=page_count,
letter_max_pages=current_app.config['LETTER_MAX_PAGES'],
**(get_template_error_dict(exception) if exception else {}),
)