mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
.keys() now returns a generator, gotta wrap it in a list() for what we do here
This commit is contained in:
parent
5f0b1b7450
commit
0335bcbf4c
1 changed files with 4 additions and 4 deletions
|
@ -540,7 +540,7 @@ def user_group_list(short=False, full=False, include_primary_groups=True):
|
||||||
groups[name]["permissions"] = [_ldap_path_extract(p, "cn") for p in infos.get("permission", [])]
|
groups[name]["permissions"] = [_ldap_path_extract(p, "cn") for p in infos.get("permission", [])]
|
||||||
|
|
||||||
if short:
|
if short:
|
||||||
groups = groups.keys()
|
groups = list(groups.keys())
|
||||||
|
|
||||||
return {'groups': groups}
|
return {'groups': groups}
|
||||||
|
|
||||||
|
@ -625,7 +625,7 @@ def user_group_delete(operation_logger, groupname, force=False, sync_perm=True):
|
||||||
from yunohost.permission import permission_sync_to_user
|
from yunohost.permission import permission_sync_to_user
|
||||||
from yunohost.utils.ldap import _get_ldap_interface
|
from yunohost.utils.ldap import _get_ldap_interface
|
||||||
|
|
||||||
existing_groups = user_group_list()['groups'].keys()
|
existing_groups = list(user_group_list()['groups'].keys())
|
||||||
if groupname not in existing_groups:
|
if groupname not in existing_groups:
|
||||||
raise YunohostError('group_unknown', group=groupname)
|
raise YunohostError('group_unknown', group=groupname)
|
||||||
|
|
||||||
|
@ -633,7 +633,7 @@ def user_group_delete(operation_logger, groupname, force=False, sync_perm=True):
|
||||||
# without the force option...
|
# without the force option...
|
||||||
#
|
#
|
||||||
# We also can't delete "all_users" because that's a special group...
|
# We also can't delete "all_users" because that's a special group...
|
||||||
existing_users = user_list()['users'].keys()
|
existing_users = list(user_list()['users'].keys())
|
||||||
undeletable_groups = existing_users + ["all_users", "visitors"]
|
undeletable_groups = existing_users + ["all_users", "visitors"]
|
||||||
if groupname in undeletable_groups and not force:
|
if groupname in undeletable_groups and not force:
|
||||||
raise YunohostError('group_cannot_be_deleted', group=groupname)
|
raise YunohostError('group_cannot_be_deleted', group=groupname)
|
||||||
|
@ -669,7 +669,7 @@ def user_group_update(operation_logger, groupname, add=None, remove=None, force=
|
||||||
from yunohost.permission import permission_sync_to_user
|
from yunohost.permission import permission_sync_to_user
|
||||||
from yunohost.utils.ldap import _get_ldap_interface
|
from yunohost.utils.ldap import _get_ldap_interface
|
||||||
|
|
||||||
existing_users = user_list()['users'].keys()
|
existing_users = list(user_list()['users'].keys())
|
||||||
|
|
||||||
# Refuse to edit a primary group of a user (e.g. group 'sam' related to user 'sam')
|
# Refuse to edit a primary group of a user (e.g. group 'sam' related to user 'sam')
|
||||||
# Those kind of group should only ever contain the user (e.g. sam) and only this one.
|
# Those kind of group should only ever contain the user (e.g. sam) and only this one.
|
||||||
|
|
Loading…
Add table
Reference in a new issue