mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Refactor check page into 3 separate templates
The check page is a very complex Jinja template. It needs breaking up to make it easier to understand what’s going on. I think there are three di
This commit is contained in:
@@ -447,10 +447,16 @@ def _check_messages(service_id, template_type, upload_id, letters_as_pdf=False):
|
||||
@login_required
|
||||
@user_has_permissions('send_texts', 'send_emails', 'send_letters')
|
||||
def check_messages(service_id, template_type, upload_id):
|
||||
return render_template(
|
||||
'views/check.html',
|
||||
**_check_messages(service_id, template_type, upload_id)
|
||||
)
|
||||
|
||||
data = _check_messages(service_id, template_type, upload_id)
|
||||
|
||||
if data['row_errors']:
|
||||
return render_template('views/check/row-errors.html', **data)
|
||||
|
||||
if data['errors']:
|
||||
return render_template('views/check/column-errors.html', **data)
|
||||
|
||||
return render_template('views/check/ok.html', **data)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/<template_type>/check/<upload_id>.<filetype>", methods=['GET'])
|
||||
|
||||
Reference in New Issue
Block a user