Skip to content

Commit

Permalink
Avoid behaviour change by raising Http404 for invalid page numbers
Browse files Browse the repository at this point in the history
An earlier version of this branch would always display the first page in this
case. For compatibility we now simply return 404.
  • Loading branch information
acdha committed Dec 6, 2011
1 parent 4e0140c commit 4b087be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion haystack/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def build_page(self):
try:
page_no = int(self.request.GET.get('page', 1))
except (TypeError, ValueError):
page_no = 1
raise Http404

start_offset = (page_no - 1) * self.results_per_page
self.results[start_offset:start_offset + self.results_per_page]
Expand Down

0 comments on commit 4b087be

Please sign in to comment.