Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Commit

Permalink
raise 404 when page > pages
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed May 26, 2012
1 parent 76bab7a commit 0834752
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions july/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ def __init__(self, query, page, per_page, total=None):
else:
self.total = query.count()

if self.page > self.pages:
raise tornado.web.HTTPError(404)

def iter_pages(self, left_edge=2, left_current=2,
right_current=5, right_edge=2):
last = 0
Expand Down

0 comments on commit 0834752

Please sign in to comment.