mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-28 11:49:13 -04:00
Merge pull request #263 from alphagov/error-handling
Fix bug in error handlers.
This commit is contained in:
@@ -184,15 +184,11 @@ def register_errorhandlers(application):
|
||||
|
||||
@application.errorhandler(HTTPError)
|
||||
def render_http_error(error):
|
||||
error_code = getattr(error, 'code', 500)
|
||||
error_code = error.status_code
|
||||
if error_code not in [401, 404, 403, 500]:
|
||||
error_code = 500
|
||||
return _error_response(error_code)
|
||||
|
||||
@application.errorhandler(400)
|
||||
def handle_bad_request(error):
|
||||
return _error_response(404)
|
||||
|
||||
@application.errorhandler(404)
|
||||
def handle_not_found(error):
|
||||
return _error_response(404)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from flask import (
|
||||
abort,
|
||||
render_template,
|
||||
session,
|
||||
flash
|
||||
@@ -25,7 +24,7 @@ def service_dashboard(service_id):
|
||||
if session.get('invited_user'):
|
||||
session.pop('invited_user', None)
|
||||
service_name = service['data']['name']
|
||||
message = 'You have sucessfully accepted your invitation and been added to {}'.format(service_name)
|
||||
message = 'You have successfully accepted your invitation and been added to {}'.format(service_name)
|
||||
flash(message, 'default_with_tick')
|
||||
|
||||
return render_template(
|
||||
|
||||
Reference in New Issue
Block a user