Skip to content

Assertion error with OffsetLimit Pagination #2920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chescales opened this issue May 8, 2015 · 3 comments
Closed

Assertion error with OffsetLimit Pagination #2920

chescales opened this issue May 8, 2015 · 3 comments
Labels
Milestone

Comments

@chescales
Copy link

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!

@tomchristie
Copy link
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)

@tomchristie tomchristie added this to the 3.1.4 Release milestone Jul 23, 2015
@tomchristie
Copy link
Member

Resolved in master. Thanks for the report!

@chescales
Copy link
Author

Thanks for your time!!

@tomchristie tomchristie modified the milestones: 3.1.4 Release, 3.2.0 Release Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants