aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-19 16:56:46 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-19 16:56:46 +0200
commit1b7fc0bc414537629ca79be2a48b2d9ea0a57000 (patch)
tree948e9f4bf9e6f62af113a192aa046196b82e5ae3 /pyaggr3g470r
parentFixed bug. (diff)
downloadnewspipe-1b7fc0bc414537629ca79be2a48b2d9ea0a57000.tar.gz
newspipe-1b7fc0bc414537629ca79be2a48b2d9ea0a57000.tar.bz2
newspipe-1b7fc0bc414537629ca79be2a48b2d9ea0a57000.zip
Handling PermissionDenied Exception.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index d23a7693..c50e2b45 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -95,8 +95,8 @@ def authentication_required(e):
@app.errorhandler(403)
def authentication_failed(e):
- flash('Authentication failed.', 'danger')
- return redirect(url_for('login')), 403
+ flash('Forbidden.', 'danger')
+ return redirect(url_for('login'))
@app.errorhandler(404)
def page_not_found(e):
@@ -610,7 +610,7 @@ def dashboard():
@app.route('/admin/create_user/', methods=['GET', 'POST'])
@app.route('/admin/edit_user/<int:user_id>/', methods=['GET', 'POST'])
@login_required
-@admin_permission.require()
+@admin_permission.require(http_exception=403)
def create_user(user_id=None):
"""
Create or edit a user.
@@ -654,7 +654,7 @@ def create_user(user_id=None):
@app.route('/admin/user/<int:user_id>/', methods=['GET'])
@login_required
-@admin_permission.require()
+@admin_permission.require(http_exception=403)
def user(user_id=None):
"""
See information about a user (stations, etc.).
@@ -668,7 +668,7 @@ def user(user_id=None):
@app.route('/admin/delete_user/<int:user_id>/', methods=['GET'])
@login_required
-@admin_permission.require()
+@admin_permission.require(http_exception=403)
def delete_user(user_id=None):
"""
Delete a user (with its stations and measures).
bgstack15