From bdbb17ef6a559a1607fac527ace0d88998a8dfd8 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Thu, 28 Sep 2023 09:37:35 +0530 Subject: [PATCH] fix(usergroup): fixes inspect when group has deleted projects --- riocli/usergroup/inspect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/riocli/usergroup/inspect.py b/riocli/usergroup/inspect.py index e3fd10b3..ea1e81bf 100644 --- a/riocli/usergroup/inspect.py +++ b/riocli/usergroup/inspect.py @@ -55,7 +55,8 @@ def to_manifest(usergroup: UserGroup, org_guid: str) -> typing.Dict: role_map = {i['projectGUID']: i['groupRole'] for i in (usergroup.role_in_projects or [])} members = {m.email_id for m in usergroup.members} admins = {a.email_id for a in usergroup.admins} - projects = [{'name': p.name, 'role': role_map[p.guid]} for p in (usergroup.projects or [])] + projects = [{'name': p.name, 'role': role_map.get(p.guid)} + for p in (usergroup.projects or []) if p.guid in role_map] return { 'apiVersion': 'api.rapyuta.io/v2',