From 5d7085b85811b16bd962f079fb296752a839b93e Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 30 Apr 2022 06:10:45 +0200 Subject: [PATCH] Fix @permission_required to avoid double call --- app/decorators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/decorators.py b/app/decorators.py index d6c6ed2346..83441275ec 100644 --- a/app/decorators.py +++ b/app/decorators.py @@ -87,10 +87,10 @@ def permission_required(permission): def decorated_function(*args, **kwargs): scodoc_dept = getattr(g, "scodoc_dept", None) if not current_user.has_permission(permission, scodoc_dept): - abort(403) + return current_app.login_manager.unauthorized() return f(*args, **kwargs) - return login_required(decorated_function) + return decorated_function return decorator