-
-
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
LimitOffsetPagination limit=0 fix #3444
Conversation
@nhorelik mostly just keeping the linters happy. @tomchristie @xordoquy thoughts on this? Seems like a valid enhancement to me. |
Seems valid, though I feel like this is something which should be handled in |
If you set If you prefer to treat a limit of zero as an invalid query param and use the defaults for everything including when paginating the queryset, then this is a one-liner fix: just set |
Don't the other paginators consider |
We shouldn't allow users to force an unlimited queryset to be returned. Agree that an empty set makes sense. |
I also think that limit=0 should be unlimited (unlimited inside the |
I made an alternative fix for this in #3990. By default, if (Personally, I prefer to use |
Closed via #4194 |
This PR fixes an uncaught ZeroDivisionError I encountered when the
limit
query paramater was set to zero when usingrest_framework.pagination.LimitOffsetPagination
.I figured this should return an empty set like you might expect, but otherwise revert to the defaults.