mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Refactored register_errorhandlers so that it handles HTTPError
Remove most cases where we catch HTTPError
This commit is contained in:
@@ -2,12 +2,9 @@ from flask import (
|
||||
render_template,
|
||||
redirect,
|
||||
session,
|
||||
url_for,
|
||||
abort
|
||||
url_for
|
||||
)
|
||||
|
||||
from notifications_python_client.errors import HTTPError
|
||||
|
||||
from flask_login import login_user
|
||||
|
||||
from app.main import main
|
||||
@@ -31,11 +28,6 @@ def verify():
|
||||
activated_user = users_dao.activate_user(user)
|
||||
login_user(activated_user)
|
||||
return redirect(url_for('main.add_service', first='first'))
|
||||
except HTTPError as e:
|
||||
if e.status_code == 404:
|
||||
abort(404)
|
||||
else:
|
||||
raise e
|
||||
finally:
|
||||
del session['user_details']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user