Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
version 3.15.2 python 3.10.14
Not sure if this is expected behavior, but when page_query_param == 0, the page_number variable sets to 1 in get_page_number:
get_page_number
def get_page_number(self, request, paginator): page_number = request.query_params.get(self.page_query_param) or 1 if page_number in self.last_page_strings: page_number = paginator.num_pages return page_number
where:
>>> page_number = request.query_params.get(self.page_query_param) or 1 >>> page_number = 0 or 1 >>> page_number = 1
I believe the original intention is to check empty string not value 0: #8578
I would consider the get_page_number function to allow value 0:
def get_page_number(self, request, paginator): """ Overrides the get_page_number method to handle case where page=0 """ param_numer = request.query_params.get(self.page_query_param) return 0 if param_numer == 0 else super().get_page_number(request, paginator)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
version 3.15.2
python 3.10.14
Not sure if this is expected behavior, but when page_query_param == 0, the page_number variable sets to 1 in
get_page_number
:where:
I believe the original intention is to check empty string not value 0: #8578
I would consider the
get_page_number
function to allow value 0:The text was updated successfully, but these errors were encountered: