Prevent deletion of the new admins group

This commit is contained in:
Alexandre Aubin 2022-01-11 17:11:45 +01:00
parent b84c1c24b4
commit 9126beffc2

View file

@ -1081,7 +1081,7 @@ def user_group_delete(operation_logger, groupname, force=False, sync_perm=True):
#
# We also can't delete "all_users" because that's a special group...
existing_users = list(user_list()["users"].keys())
undeletable_groups = existing_users + ["all_users", "visitors"]
undeletable_groups = existing_users + ["all_users", "visitors", "admins"]
if groupname in undeletable_groups and not force:
raise YunohostValidationError("group_cannot_be_deleted", group=groupname)