Commit e6e23755 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

Rietveld: fix search query.

R=maruel@chromium.org,jrobbins@chromium.org
BUG=712060

Change-Id: I16651d9926fe0f3a74549a4c03896220f9a58f94
Reviewed-on: https://chromium-review.googlesource.com/482659Reviewed-by: 's avatarMarc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent b624bfe0
......@@ -310,6 +310,13 @@ class Rietveld(object):
'private': private,
'commit': commit,
}
# The integer values were determined by checking HTML source of Rietveld on
# https://codereview.chromium.org/search. See also http://crbug.com/712060.
three_state_value_map = {
None: 1, # Unknown.
True: 2, # Yes.
False: 3, # No.
}
url = '/search?format=json'
# Sort the keys mainly to ease testing.
......@@ -320,7 +327,7 @@ class Rietveld(object):
for key in sorted(three_state_keys):
value = three_state_keys[key]
if value is not None:
url += '&%s=%s' % (key, value)
url += '&%s=%d' % (key, three_state_value_map[value])
if keys_only:
url += '&keys_only=True'
......
......@@ -344,9 +344,9 @@ class RietveldTest(BaseFixture):
'&modified_before=2010-02-01'
'&owner=owner%40example.com'
'&reviewer=reviewer%40example.com'
'&closed=True'
'&commit=True'
'&private=True'
'&closed=2'
'&commit=2'
'&private=2'
'&keys_only=True'
'&with_messages=True'
'&limit=23')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment