adjusts users and groups startup scripts to accomdate non-uniqueness
This commit is contained in:
parent
5a4e9d7a14
commit
e6e7647f32
@ -29,6 +29,6 @@ with file.open('r') as stream:
|
||||
if user_permissions:
|
||||
user.user_permissions.clear()
|
||||
for permission_codename in user_details.get('permissions', []):
|
||||
permission = Permission.objects.get(codename=permission_codename)
|
||||
user.user_permissions.add(permission)
|
||||
for permission in Permission.objects.filter(codename=permission_codename):
|
||||
user.user_permissions.add(permission)
|
||||
user.save()
|
||||
|
@ -29,5 +29,5 @@ with file.open('r') as stream:
|
||||
group.permissions.clear()
|
||||
print("Permissions:", group.permissions.all())
|
||||
for permission_codename in group_details.get('permissions', []):
|
||||
permission = Permission.objects.get(codename=permission_codename)
|
||||
group.permissions.add(permission)
|
||||
for permission in Permission.objects.filter(codename=permission_codename):
|
||||
group.permissions.add(permission)
|
||||
|
Loading…
Reference in New Issue
Block a user