Skip to content

Commit 70f96f9

Browse files
jacob-kellerstephenfin
authored andcommitted
support the delegate filter for REST API
The REST API does not add the delegate filter to the REST API query, which makes using -d give unexpected results: If you add -d <something> then you will still obtain all patches, and then print them out sorted by delegate. Fix this by passing the delegate as a filter to the query command. I suspect this was not implemented before because the REST API may not actually allow partial names for the delegate. I believe this is still valuable to support even if it requires strict matching against the delegate names or IDs. If a match is desirable, this could be refactored to query the set of delegates from the API, find all the IDs which match, and then make multiple calls to _list for each matching delegate ID. I did not attempt to implement that. Signed-off-by: Jacob Keller <[email protected]>
1 parent 4d2f914 commit 70f96f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pwclient/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,9 @@ def patch_list(
747747
if archived is not None:
748748
filters['archived'] = archived
749749

750+
if delegate is not None:
751+
filters['delegate'] = delegate
752+
750753
patches = self._list('patches', params=filters)
751754
return [self._patch_to_dict(patch) for patch in patches]
752755

0 commit comments

Comments
 (0)