diff options
| author | Tom Christie | 2015-03-16 12:05:31 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-03-16 12:05:31 +0000 |
| commit | 5cd0714dcae2409a05f6aa184afe87f8e9748ed3 (patch) | |
| tree | edf26d14a3bd1311023f3f428e1cf6a14ebd8954 /rest_framework | |
| parent | 4cd49d5de38b860e4b2260d7fa82dbdf9256c6e8 (diff) | |
| download | django-rest-framework-5cd0714dcae2409a05f6aa184afe87f8e9748ed3.tar.bz2 | |
Do not paginate if PAGE_SIZE=None
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/pagination.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index 5e60448d..b6be6b7c 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -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 @@ -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) |
