-
-
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
Don't strip empty query params when paginating #4260
Conversation
- Add `keep_blank_values=True` to `urlparse.parse_qs` calls
Current coverage is 91.23%@@ master #4260 diff @@
==========================================
Files 52 52
Lines 5776 5776
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 5270 5270
Misses 506 506
Partials 0 0
|
Why is that a problem? Closing for now, but may consider reopening given sufficient cause. |
The GET http://testserver/?filter=
This means that when paginating the next and previous pages could contain a completely different data set from the current query if the API is relying on this behaviour. We currently have an implementation that uses this behaviour for passing search strings into the API. An empty search string is considered valid and returns different results than when the search param is not provided at all. As a result of this only the first page from DRF is valid, all subsequent pages contain the incorrect dataset. |
Gotcha - thanks for clarifying. |
Description
Fixes issue with pagination when the url contains empty query params. The previous implementation would strip out any empty query params from the
next
andprevious
urls. This PR fixes the query parsing and ensures that empty query params are preserved.This possibly fixes #3328.