Skip to content

Commit

Permalink
fix(organization): fix organization select command
Browse files Browse the repository at this point in the history
The organization select command checks whether the currently set
organization is already the selected one. It relies on the
organization_id in the config. However, there may be a case where the
config may not have the organization entry. In such a case, accessing
the key without .get() throws a key error. This commit rectifies the
issue.

Wrike Ticket:
  • Loading branch information
pallabpain committed Jul 30, 2024
1 parent 7581edc commit 61bf904
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion riocli/organization/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def select_organization(
"""
ctx = get_root_context(ctx)

if ctx.obj.data['organization_id'] == organization_guid:
if ctx.obj.data.get('organization_id') == organization_guid:
click.secho("You are already in the '{}' organization".format(
organization_name), fg=Colors.GREEN)
return
Expand Down

0 comments on commit 61bf904

Please sign in to comment.