Skip to content

Commit

Permalink
fix(device): filter uploaded files by name in name_to_request_id
Browse files Browse the repository at this point in the history
The name_to_request_id decorator in device utils tries to find the
request id corresponding an uploaded file. It invoke a list call to
fetch the files and find out the id. However,
list_uploaded_files_for_device SDK method supports filtering by file
name.

This commit fixes the call to filter with file name to only return the
required data.

Wrike Ticket: https://www.wrike.com/open.htm?id=1463047318
  • Loading branch information
pallabpain authored and ankitrgadiya committed Jul 30, 2024
1 parent d703df3 commit 7348be2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions riocli/device/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def decorated(**kwargs):
click.secho(str(e), fg=Colors.RED)
raise SystemExit(1)

file_name = kwargs.pop('file_name')

device_guid = kwargs.get('device_guid')
device = client.get_device(device_id=device_guid)
requests = device.list_uploaded_files_for_device()

file_name = kwargs.pop('file_name')
requests = device.list_uploaded_files_for_device(filter_by_filename=file_name)

file_name, request_id = find_request_id(requests, file_name)

Expand Down

0 comments on commit 7348be2

Please sign in to comment.