Skip to content

Commit

Permalink
fix(usergroup): fixes inspect when group has deleted projects
Browse files Browse the repository at this point in the history
  • Loading branch information
pallabpain committed Sep 28, 2023
1 parent d93d2b2 commit bdbb17e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion riocli/usergroup/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit bdbb17e

Please sign in to comment.