Skip to content

Commit

Permalink
Amend regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Mar 23, 2023
1 parent 370a5f8 commit e69bf20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rest_framework/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,9 @@ def paginate_queryset(self, queryset, request, view=None):
kwargs = {order_attr + '__gt': current_position}

# If some records contain a null for the ordering field, don't lose them.
filter_query = Q(**kwargs) | Q(**{order_attr + '__isnull': True})
filter_query = Q(**kwargs)
if reverse:
filter_query |= Q(**{order_attr + '__isnull': True})
queryset = queryset.filter(filter_query)

# If we have an offset cursor then offset the entire page by that amount.
Expand Down

0 comments on commit e69bf20

Please sign in to comment.