Skip to content

Assertion error with OffsetLimit Pagination #2920

Closed

Description

@chescales

To reproduce this bug place a default pagination limit of, for instance, 50. This with the LimitOffset pagination. Then, in the browsable API for instance, let's say we have 17 objects of a specific collection. This bug happens when you put a different "limit" value than the default, and an "offset" higher than the amount of items.

In summary, for a default of 50 items per page, and 17 items in the collection returned:

https://url_to_list_endpoint/?limit=2&offset=18 (triggers AssertionError)
https://url_to_list_endpoint/?limit=2&offset=50 (triggers AssertionError)
https://url_to_list_endpoint/?offset=50 (does not trigger AssertionError)

Exception Location: .../venv/lib/python2.7/site-packages/rest_framework/pagination.py in _get_displayed_page_numbers, line 74

Thanks for the hard work!

Activity

  1. lovelydinosaur commented on Jul 22, 2015

    @lovelydinosaur
    Member

    If anyone wants to jump into this before I get there...

    Required to progress this: replication/confirmation, failing test case.

    (Does appear valid for what its worth)

  2. added this to the milestone on Jul 23, 2015
  3. lovelydinosaur commented on Jul 23, 2015

    @lovelydinosaur
    Member

    Resolved in master. Thanks for the report!

  4. chescales commented on Jul 23, 2015

    @chescales
    Author

    Thanks for your time!!

  5. modified the milestones: , 3.2.0 Release on Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions