Skip to content

Commit

Permalink
fix(config): new_client without project now does not read project fro…
Browse files Browse the repository at this point in the history
…m 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 #49
  • Loading branch information
ankitrgadiya committed Oct 13, 2022
1 parent 07b8594 commit 7c2c5fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions riocli/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7c2c5fd

Please sign in to comment.