correct flake8 in object_permissions.py
This commit is contained in:
parent
4e31218ce6
commit
528bc17eb8
@ -14,7 +14,7 @@ for permission_name, permission_details in object_permissions.items():
|
|||||||
|
|
||||||
object_permission, created = ObjectPermission.objects.get_or_create(
|
object_permission, created = ObjectPermission.objects.get_or_create(
|
||||||
name=permission_name,
|
name=permission_name,
|
||||||
description=permission_details["description"],
|
description=permission_details["description"],
|
||||||
enabled=permission_details["enabled"],
|
enabled=permission_details["enabled"],
|
||||||
actions=permission_details["actions"],
|
actions=permission_details["actions"],
|
||||||
)
|
)
|
||||||
@ -26,7 +26,7 @@ for permission_name, permission_details in object_permissions.items():
|
|||||||
object_permission.save()
|
object_permission.save()
|
||||||
|
|
||||||
print("🔓 Created object permission", object_permission.name)
|
print("🔓 Created object permission", object_permission.name)
|
||||||
|
|
||||||
if permission_details.get("groups", 0):
|
if permission_details.get("groups", 0):
|
||||||
for groupname in permission_details["groups"]:
|
for groupname in permission_details["groups"]:
|
||||||
group = AdminGroup.objects.get(name=groupname)
|
group = AdminGroup.objects.get(name=groupname)
|
||||||
@ -34,7 +34,7 @@ for permission_name, permission_details in object_permissions.items():
|
|||||||
if group:
|
if group:
|
||||||
object_permission.groups.add(group)
|
object_permission.groups.add(group)
|
||||||
print(
|
print(
|
||||||
" 👥 Assigned group %s object permission of %s" % (groupname, object_permission.name)
|
" 👥 Assigned group %s object permission of %s" % (groupname, groupname)
|
||||||
)
|
)
|
||||||
|
|
||||||
if permission_details.get("users", 0):
|
if permission_details.get("users", 0):
|
||||||
@ -44,7 +44,7 @@ for permission_name, permission_details in object_permissions.items():
|
|||||||
if user:
|
if user:
|
||||||
object_permission.users.add(user)
|
object_permission.users.add(user)
|
||||||
print(
|
print(
|
||||||
" 👤 Assigned user %s object permission of %s" % (username, object_permission.name)
|
" 👤 Assigned user %s object permission of %s" % (username, groupname)
|
||||||
)
|
)
|
||||||
|
|
||||||
object_permission.save()
|
object_permission.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user