Do not assume that users and groups keys exist in permissions
This commit is contained in:
parent
3329788be8
commit
901fea3361
@ -27,9 +27,11 @@ def assign_permissions(project, node_types, permission_callback):
|
||||
permissions = {}
|
||||
|
||||
for key in ('users', 'groups'):
|
||||
perms = proj_perms[key]
|
||||
singular = key.rstrip('s')
|
||||
perms = proj_perms.get(key)
|
||||
if not perms:
|
||||
continue
|
||||
|
||||
singular = key.rstrip('s')
|
||||
for perm in perms:
|
||||
assert isinstance(perm, dict), 'perm should be dict, but is %r' % perm
|
||||
ident = perm[singular] # group or user ID.
|
||||
|
Loading…
x
Reference in New Issue
Block a user