mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
make error handler work if only one error message
This commit is contained in:
@@ -447,7 +447,10 @@ def register_errorhandlers(application):
|
|||||||
))
|
))
|
||||||
error_code = error.status_code
|
error_code = error.status_code
|
||||||
if error_code == 400:
|
if error_code == 400:
|
||||||
msg = list(itertools.chain(*[error.message[x] for x in error.message.keys()]))
|
if isinstance(error.message, str):
|
||||||
|
msg = [error.message]
|
||||||
|
else:
|
||||||
|
msg = list(itertools.chain(*[error.message[x] for x in error.message.keys()]))
|
||||||
resp = make_response(render_template("error/400.html", message=msg))
|
resp = make_response(render_template("error/400.html", message=msg))
|
||||||
return useful_headers_after_request(resp)
|
return useful_headers_after_request(resp)
|
||||||
elif error_code not in [401, 404, 403, 410, 500]:
|
elif error_code not in [401, 404, 403, 410, 500]:
|
||||||
|
|||||||
Reference in New Issue
Block a user