Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4052 closed (duplicate)

implicitly control in paginator causes unexpected return values.

Reported by: meren@… Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: Keywords: paginator
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



Pagiantor doesn't check the 'page_number' value in "has_next_page" and "has_previous_page" functions. It causes this:

>>> from django.core.paginator import ObjectPaginator
>>> from import Entry
>>> e = Entry.objects.all()
>>> len(e)
>>> paginator_result = ObjectPaginator(e, 10)
>>> paginator_result.pages
>>> page_number = 0
>>> paginator_result.has_next_page(page)
>>> paginator_result.has_previous_page(page)
>>> page_number = "0"
>>> paginator_result.has_next_page(page)
>>> paginator_result.has_previous_page(page)

Please review the patch attached below (I'm sorry if ticket is in the wrong component, I couldn't find any closer).


  1. Murat Eren.

Change History (2)

comment:1 Changed 12 years ago by meren@…

Has patch: unset
Resolution: duplicate
Status: newclosed

Oh.. This one is a mistake, I tried to stop my browser after I pressed submit button, but it seems I couldn't. Sorry. The real report is here: #4052

comment:2 Changed 12 years ago by meren@…

Not there, here: #4053 *sigh* (I'm not Peter Sellers and I didn't come here to ruin your ticket system).

Note: See TracTickets for help on using tickets.
Back to Top