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