Skip to content

Commit 52ea962

Browse files
committed
fix: getVersion should be in URL params not in the body
1 parent ce6d601 commit 52ea962

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

algoliasearch/search_index.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ def get_settings(self, request_options=None):
236236

237237
params = {'getVersion': 2}
238238

239+
if request_options is None:
240+
request_options = {'getVersion':2}
241+
else:
242+
request_options.append({'getVersion':2})
243+
239244
raw_response = self._transporter.read(
240245
Verb.GET,
241246
endpoint('1/indexes/{}/settings', self._name),

algoliasearch/search_index_async.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@ def browse_rules_async(self, request_options=None):
8080
def get_settings_async(self, request_options=None): # type: ignore
8181
# type: (Optional[Union[dict, RequestOptions]]) -> dict
8282

83-
params = {'getVersion': 2}
83+
if request_options == None:
84+
request_options = {'getVersion':2}
85+
else:
86+
request_options.append({'getVersion':2})
8487

8588
raw_response = yield from self._transporter_async.read(
8689
Verb.GET,
8790
endpoint('1/indexes/{}/settings', self._name),
88-
params,
91+
None,
8992
request_options
9093
)
9194

tests/features/test_account_client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ def test_cross_app_copy_index(self):
4646
self.assertEqual(self.index2.get_rule('one'), rule)
4747

4848
# Assert synonyms got copied
49+
list_synonyms1 = []
50+
list_synonyms2 = []
51+
52+
for synonym1 in self.index.browse_synonyms():
53+
list_synonyms1.append(synonym1)
54+
55+
for synonym2 in self.index2.browse_synonyms():
56+
list_synonyms2.append(synonym2)
57+
58+
self.assertEqual(list_synonyms1,list_synonyms1)
59+
60+
# Assert synomys are the same
4961
self.assertEqual(self.index2.get_synonym('one'), synonym)
5062

5163
# Assert that copying again fails because index already exists

0 commit comments

Comments
 (0)