Skip to content

Commit 6072518

Browse files
committed
Don't mix dicts and lists
We had switched from dicts to lists of tuples for filtering early in development in order to support multiple filters of the same type. Unfortunately, we didn't update all references. Resolve this now. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: #10
1 parent 35d7602 commit 6072518

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

git_pw/bundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def list_cmd(owner, limit, page, sort, name):
100100

101101
# TODO(stephenfin): It should be possible to filter bundles by owner email
102102
for own in owner:
103-
users = api.index('users', {'q': own})
103+
users = api.index('users', [('q', own)])
104104
if len(users) == 0:
105105
LOG.error('No matching owner found: %s', own)
106106
sys.exit(1)

git_pw/patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def update_cmd(patch_id, commit_ref, state, delegate, archived):
130130
patch_id, commit_ref, state, archived)
131131

132132
if delegate:
133-
users = api.index('users', {'q': delegate})
133+
users = api.index('users', [('q', delegate)])
134134
if len(users) == 0:
135135
LOG.error('No matching delegates found: %s', delegate)
136136
sys.exit(1)
@@ -202,7 +202,7 @@ def list_cmd(state, submitter, delegate, archived, limit, page, sort, name):
202202

203203
# TODO(stephenfin): It should be possible to filter patches submitter email
204204
for subm in submitter:
205-
people = api.index('people', {'q': subm})
205+
people = api.index('people', [('q', subm)])
206206
if len(people) == 0:
207207
LOG.error('No matching submitter found: %s', subm)
208208
sys.exit(1)
@@ -213,7 +213,7 @@ def list_cmd(state, submitter, delegate, archived, limit, page, sort, name):
213213
params.append(('submitter', people[0]['id']))
214214

215215
for delg in delegate:
216-
users = api.index('users', {'q': delg})
216+
users = api.index('users', [('q', delg)])
217217
if len(users) == 0:
218218
LOG.error('No matching delegates found: %s', delg)
219219
sys.exit(1)

git_pw/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def list_cmd(submitter, limit, page, sort, name):
109109
# TODO(stephenfin): It should be possible to filter series by submitter
110110
# email
111111
for subm in submitter:
112-
people = api.index('people', {'q': subm})
112+
people = api.index('people', [('q', subm)])
113113
if len(people) == 0:
114114
LOG.error('No matching submitter found: %s', subm)
115115
sys.exit(1)

0 commit comments

Comments
 (0)