Skip to content

Commit

Permalink
Clean up unnecessary if statement (#6163)
Browse files Browse the repository at this point in the history
  • Loading branch information
myungsegyo authored and tomchristie committed Sep 6, 2018
1 parent 2c992f0 commit bcc565f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rest_framework/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,11 @@ def paginate_queryset(self, queryset, request, view=None):
has_following_position = False
following_position = None

# If we have a reverse queryset, then the query ordering was in reverse
# so we need to reverse the items again before returning them to the user.
if reverse:
# If we have a reverse queryset, then the query ordering was in reverse
# so we need to reverse the items again before returning them to the user.
self.page = list(reversed(self.page))

if reverse:
# Determine next and previous positions for reverse cursors.
self.has_next = (current_position is not None) or (offset > 0)
self.has_previous = has_following_position
Expand Down

0 comments on commit bcc565f

Please sign in to comment.