Fix group none error
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2024-08-28 11:22:33 +03:00
parent 8d296286f1
commit b9364f0e3d
2 changed files with 3 additions and 3 deletions

View File

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