From 8678ad92ce2e2609cb39f69d73d14c2afe40f1ec Mon Sep 17 00:00:00 2001 From: ryanmerolle Date: Mon, 26 Apr 2021 09:17:25 -0400 Subject: [PATCH] update permission user & group lookup as suggested --- startup_scripts/015_object_permissions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/startup_scripts/015_object_permissions.py b/startup_scripts/015_object_permissions.py index c17ce84..f19b6ae 100644 --- a/startup_scripts/015_object_permissions.py +++ b/startup_scripts/015_object_permissions.py @@ -43,7 +43,7 @@ for permission_name, permission_details in object_permissions.items(): if permission_details.get("groups", 0): for groupname in permission_details["groups"]: - group = AdminGroup.objects.get(name=groupname) + group = AdminGroup.objects.filter(name=groupname).first() if group: object_permission.groups.add(group) @@ -51,7 +51,7 @@ for permission_name, permission_details in object_permissions.items(): if permission_details.get("users", 0): for username in permission_details["users"]: - user = AdminUser.objects.get(username=username) + user = AdminUser.objects.filter(username=username).first() if user: object_permission.users.add(user)