DRF pagination mixing page_size of multiple views #8471
Unanswered
anshukch
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're using Django 1.11.29. The DRF we use is customised after v3.9.4 release. The customisation is bypassing
KeyError
whileserializer
pop
inReturnDict
andReturnList
classes in serializer_helpers.py#L19. This is needed to support voluptous for our tests.Following is our pagination class
Both
DEFAULT_PAGINATION_CLASS
andPAGE_SIZE
(equal to 9) are specified insettings.py
as well.Problem
There are two views(
viewsets.ReadOnlyModelViewSet
actually). One has apage_size=3
and another has apage_size=4
. When the client loads a page, both of these paginated APIs are called. While rendering the request, the APIs are mixing the page_sizes. The first response has correct page sizes. But some of the subsequent responses are returning responses with page_size of 4 and 3 respectively. The mixup is being detected here in pagination.py#L194. I wasn't able to debug this further. Please advise.Beta Was this translation helpful? Give feedback.
All reactions