Fix group none error
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -21,7 +21,7 @@ def login_required(_f=None, *, groups=[]):
|
||||
user = read_user()
|
||||
if not user:
|
||||
return do_login()
|
||||
if groups and not any(group in groups for group in user["groups"]):
|
||||
if groups and not any(group in groups for group in user.get("groups", [])):
|
||||
return "not allowed", 401
|
||||
return f(*args, **kwargs)
|
||||
return decorated_function
|
||||
|
Reference in New Issue
Block a user