From 68de8f883587d0e4021a818f0054b179e660c5ad Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 22 Nov 2021 16:22:34 +0530 Subject: [PATCH] Fix instance --- app/management/commands/fix_people_resource_role.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/management/commands/fix_people_resource_role.py b/app/management/commands/fix_people_resource_role.py index 9da5d5a..925a8c7 100644 --- a/app/management/commands/fix_people_resource_role.py +++ b/app/management/commands/fix_people_resource_role.py @@ -8,7 +8,7 @@ class Command(BaseCommand): def handle(self, *args, **options): prs = PeopleResource.objects.all() roles = Role.objects.all() - role_map = {r.role: r.id for r in roles} + role_map = {r.role: r for r in roles} for pr in prs: pr.p_r_role = role_map.get(pr.role, role_map.get('')) pr.save()