-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Labels
Milestone
Comments
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) |
Resolved in master. Thanks for the report! |
Thanks for your time!! |
This was referenced Mar 9, 2017
This was referenced Oct 16, 2017
This was referenced Nov 6, 2017
This was referenced Nov 14, 2017
This was referenced Dec 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!
The text was updated successfully, but these errors were encountered: