1
0
forked from ScoDoc/ScoDoc

Fix @permission_required to avoid double call

This commit is contained in:
Emmanuel Viennet 2022-04-30 06:10:45 +02:00
parent 1a18fef3e0
commit 5d7085b858

View File

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