forked from ScoDoc/DocScoDoc
Fix @permission_required to avoid double call
This commit is contained in:
parent
1a18fef3e0
commit
5d7085b858
@ -87,10 +87,10 @@ def permission_required(permission):
|
|||||||
def decorated_function(*args, **kwargs):
|
def decorated_function(*args, **kwargs):
|
||||||
scodoc_dept = getattr(g, "scodoc_dept", None)
|
scodoc_dept = getattr(g, "scodoc_dept", None)
|
||||||
if not current_user.has_permission(permission, scodoc_dept):
|
if not current_user.has_permission(permission, scodoc_dept):
|
||||||
abort(403)
|
return current_app.login_manager.unauthorized()
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
|
|
||||||
return login_required(decorated_function)
|
return decorated_function
|
||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user