Skip to content

Commit

Permalink
fix(project): sends org when fetching guid from name (#287)
Browse files Browse the repository at this point in the history
The find_project_guid expects an organization guid. However, the
name_to_guid decorator that calls the helper function did not send it.
It led to cases where you can resolve guids of projects not present in
the organization of the current context.

Wrike Ticket: https://www.wrike.com/open.htm?id=1326736542
  • Loading branch information
pallabpain authored Mar 21, 2024
1 parent 264c77b commit 6eb340b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions riocli/project/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from rapyuta_io import Client

from riocli.config import new_client, new_v2_client
from riocli.constants import Colors
from riocli.constants import Colors, Symbols
from riocli.exceptions import LoggedOut
from riocli.utils.selector import show_selection
from riocli.v2client import Client as v2Client
Expand Down Expand Up @@ -49,9 +49,10 @@ def decorated(**kwargs: typing.Any):

if guid is None:
try:
guid = find_project_guid(client, name)
organization = ctx.obj.data.get('organization_id')
guid = find_project_guid(client, name, organization)
except Exception as e:
click.secho(str(e), fg=Colors.RED)
click.secho('{} {}'.format(Symbols.ERROR, e), fg=Colors.RED)
raise SystemExit(1)

kwargs['project_name'] = name
Expand Down

0 comments on commit 6eb340b

Please sign in to comment.