django-haystack / django-haystack/django-haystack
Unnecessary code in SearchView.build_page
Open
Nobody has claimed this yet.
needs review
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 1.3k
- Avg merge
- 3h 18m
- Merged PRs (30d)
- 3
Description
Lines 106 and 107 seem to be defunct.
start_offset = (page_no - 1) * self.results_per_page
self.results[start_offset:start_offset + self.results_per_page]
The resulting slice isn't used. Is it there to determine if there are results for this page, because paginator already handles this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in haystack/views.py at lines 106-107 within SearchView.build_page and inspect how the paginator handles the page. Confirm that the slice result is unused, then remove the defunct code and verify that pagination behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- search
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100