From 7c2c5fd3c9330f4df38e7160083cbcd81a8a7fb4 Mon Sep 17 00:00:00 2001 From: Ankit R Gadiya Date: Tue, 4 Oct 2022 12:21:51 +0530 Subject: [PATCH] fix(config): new_client without project now does not read project from config When `new_client` function was called with `with_project=False`, it could still read project_id from the config file. So, if first user is part of a Project but second user (second login) is not, it can raise an exception. This issue is fixed in this commit. Resolves https://github.com/rapyuta-robotics/rapyuta-io-cli/issues/49 --- riocli/config/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/riocli/config/config.py b/riocli/config/config.py index e880198b..8eccbd62 100644 --- a/riocli/config/config.py +++ b/riocli/config/config.py @@ -73,6 +73,9 @@ def new_client(self, with_project: bool = True) -> Client: if with_project and project is None: raise NoProjectSelected + if not with_project: + project = None + return Client(auth_token=token, project=project) def get_auth_header(self) -> dict: