mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Add a check in CursorPagination.paginate_queryset to only apply the default the order_by method if the queryset is not ordered.
This commit is contained in:
parent
e34e0536b1
commit
539748cb69
|
@ -512,6 +512,7 @@ class CursorPagination(BasePagination):
|
||||||
(offset, reverse, current_position) = self.cursor
|
(offset, reverse, current_position) = self.cursor
|
||||||
|
|
||||||
# Cursor pagination always enforces an ordering.
|
# Cursor pagination always enforces an ordering.
|
||||||
|
if not queryset.ordered:
|
||||||
if reverse:
|
if reverse:
|
||||||
queryset = queryset.order_by(*_reverse_ordering(self.ordering))
|
queryset = queryset.order_by(*_reverse_ordering(self.ordering))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user