From ed50a21f591bdd4b672473b1c8becb42f0d8c638 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Tue, 30 Jul 2024 14:42:00 +0530 Subject: [PATCH] fix(organization): fix organization select command 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: https://www.wrike.com/open.htm?id=1464951724 --- riocli/organization/select.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riocli/organization/select.py b/riocli/organization/select.py index 23faba98..3b716c57 100644 --- a/riocli/organization/select.py +++ b/riocli/organization/select.py @@ -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