mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-15 18:53:18 +00:00
Add offset when getting single item. Fixes #1271
This commit is contained in:
parent
375b25c1e5
commit
fcec9936ad
2 changed files with 2 additions and 3 deletions
|
|
@ -155,8 +155,8 @@ class BaseSearchResults(object):
|
|||
if self._results_cache is not None:
|
||||
return self._results_cache[key]
|
||||
|
||||
new.start = key
|
||||
new.stop = key + 1
|
||||
new.start = self.start + key
|
||||
new.stop = self.start + key + 1
|
||||
return list(new)[0]
|
||||
|
||||
def __iter__(self):
|
||||
|
|
|
|||
|
|
@ -454,7 +454,6 @@ class TestElasticSearchResults(TestCase):
|
|||
size=10
|
||||
)
|
||||
|
||||
@unittest.expectedFailure # 1271
|
||||
@mock.patch('elasticsearch.Elasticsearch.search')
|
||||
def test_slice_results_and_get_item(self, search):
|
||||
# Need to return something to prevent index error
|
||||
|
|
|
|||
Loading…
Reference in a new issue