From 29476ff87c2728be9ec59d369ede7f0831fd1216 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Tue, 5 Nov 2024 16:02:45 +0530 Subject: [PATCH] fix(organization): fixes key error when no org is selected (#383) When we login with auth token in silent mode, there's no org selected. The config has no org present either. This breaks the list command that tries to fetch the selected org from config to highlight it in the output. --- riocli/organization/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riocli/organization/list.py b/riocli/organization/list.py index e676df1f..d209ed2a 100644 --- a/riocli/organization/list.py +++ b/riocli/organization/list.py @@ -36,7 +36,7 @@ def list_organizations(ctx: click.Context) -> None: try: client = new_client(with_project=False) organizations = client.get_user_organizations() - current = ctx.obj.data["organization_id"] + current = ctx.obj.data.get("organization_id") print_organizations(organizations, current) except Exception as e: click.secho(str(e), fg=Colors.RED)