Refactored register_errorhandlers so that it handles HTTPError

Remove most cases where we catch HTTPError
This commit is contained in:
Rebecca Law
2016-03-10 11:53:29 +00:00
parent 2acc496734
commit f6d98b63ea
14 changed files with 110 additions and 247 deletions

View File

@@ -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']