Skip to content

Commit bcc565f

Browse files
myungsegyotomchristie
authored andcommitted
Clean up unnecessary if statement (#6163)
1 parent 2c992f0 commit bcc565f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rest_framework/pagination.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,11 @@ def paginate_queryset(self, queryset, request, view=None):
544544
has_following_position = False
545545
following_position = None
546546

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

552-
if reverse:
553552
# Determine next and previous positions for reverse cursors.
554553
self.has_next = (current_position is not None) or (offset > 0)
555554
self.has_previous = has_following_position

0 commit comments

Comments
 (0)