[Bug] Fixes for Group handling, Load all objects only if necessary (#113)

Fixes #109
Fixes #110
Fixes #111
Fixes #112

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#113
This commit is contained in:
2025-09-11 18:19:27 +12:00
parent af3981d96e
commit 7905a8c2c1
3 changed files with 32 additions and 28 deletions

View File

@ -265,7 +265,7 @@ class GroupManager(object):
@transaction.atomic
def update_members(caller: User, group: Group, member: Union[User, Group], add_or_remove: str):
if caller != group.owner:
if caller != group.owner and not caller.is_superuser:
raise ValueError('Only the group Owner is allowed to add members!')
if isinstance(member, Group):