forked from ScoDoc/ScoDoc
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):
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user