-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
LimitOffset pagination crashes Browseable API when limit=0 #4079
Comments
I am able to reproduce this behaviour. Also this is not really a crash, it just displays you an error message as you have Debug Mode set to True in your Django Project. Though I guess there is no harm done in catching this and just returning an empty result. |
Thanks for confirming @anx-ckreuzberger! |
Thanks for confirming too. It's nice to know I'm not crazy (though I did try it on a fresh project). Not sure how it's not a crash, it's a |
We are using
LimitOffsetPagination
on all our endpoints, and noticed that sendinglimit=0
to the browsable api causes a crash. Gettingjson
output (either from an xmlhttprequest or fromformat=json
) does not crash.Steps to reproduce
LimitOffsetPagination
as the default paginationlist
(ours areModelViewSet
) in the browser?limit=0&offset=20
Notes
We use a custom LimitOffset pagination, which just overrides the max and default limit
Using DRF 3.3.2
Expected behavior
Should show the browsable api for the endpoint, with the following data:
Actual behavior
The text was updated successfully, but these errors were encountered: