mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Merge pull request #1329 from cchurch/take-me-back-to-the-good-old-ways-of-pagination
Keep page number in previous link for page 1.
This commit is contained in:
commit
fc5d497ce6
@ -3,7 +3,7 @@
|
||||
|
||||
# Django REST Framework
|
||||
from rest_framework import pagination
|
||||
from rest_framework.utils.urls import remove_query_param, replace_query_param
|
||||
from rest_framework.utils.urls import replace_query_param
|
||||
|
||||
|
||||
class Pagination(pagination.PageNumberPagination):
|
||||
@ -22,6 +22,4 @@ class Pagination(pagination.PageNumberPagination):
|
||||
return None
|
||||
url = self.request and self.request.get_full_path() or ''
|
||||
page_number = self.page.previous_page_number()
|
||||
if page_number == 1:
|
||||
return remove_query_param(url, self.page_query_param)
|
||||
return replace_query_param(url, self.page_query_param, page_number)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user