Skip to content

Do not paginate if PAGE_SIZE=None #2700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rest_framework/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ class LimitOffsetPagination(BasePagination):

def paginate_queryset(self, queryset, request, view=None):
self.limit = self.get_limit(request)
if self.limit is None:
return None

self.offset = self.get_offset(request)
self.count = _get_count(queryset)
self.request = request
Expand Down Expand Up @@ -491,6 +494,9 @@ class CursorPagination(BasePagination):
template = 'rest_framework/pagination/previous_and_next.html'

def paginate_queryset(self, queryset, request, view=None):
if self.page_size is None:
return None

self.base_url = request.build_absolute_uri()
self.ordering = self.get_ordering(request, queryset, view)

Expand Down