mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-24 09:21:06 -04:00
Merge pull request #1047 from alphagov/invitation-expiry-msg
Invitation expiry msg
This commit is contained in:
@@ -5,6 +5,7 @@ from datetime import datetime, timedelta, timezone
|
||||
from time import monotonic
|
||||
|
||||
import dateutil
|
||||
import itertools
|
||||
import pytz
|
||||
import ago
|
||||
from flask import (
|
||||
@@ -405,7 +406,11 @@ def register_errorhandlers(application):
|
||||
error.message
|
||||
))
|
||||
error_code = error.status_code
|
||||
if error_code not in [401, 404, 403, 410, 500]:
|
||||
if error_code == 400:
|
||||
msg = list(itertools.chain(*[error.message[x] for x in error.message.keys()]))
|
||||
resp = make_response(render_template("error/400.html", message=msg))
|
||||
return useful_headers_after_request(resp)
|
||||
elif error_code not in [401, 404, 403, 410, 500]:
|
||||
error_code = 500
|
||||
return _error_response(error_code)
|
||||
|
||||
|
||||
11
app/templates/error/400.html
Normal file
11
app/templates/error/400.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% block page_title %}Bad Request{% endblock %}
|
||||
{% block maincolumn_content %}
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-medium">
|
||||
{{ message|join(",")}}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user