Skip to content

Commit 40735f2

Browse files
Fix setting typo
Co-authored-by: Roman Gorbil <[email protected]>
1 parent 9929cf0 commit 40735f2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

rest_framework/pagination.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,6 @@ class PageNumberPagination(BasePagination):
173173
# The default page size.
174174
# Defaults to `None`, meaning pagination is disabled.
175175
page_size = api_settings.PAGE_SIZE
176-
# The maximum page size.
177-
# Defaults to `None`, meaning page size is unlimited.
178-
# It's recommended that you would set a limit to avoid api abuse.
179-
page_size = api_settings.MAX_PAGE_SIZE
180176

181177
django_paginator_class = DjangoPaginator
182178

@@ -191,7 +187,9 @@ class PageNumberPagination(BasePagination):
191187

192188
# Set to an integer to limit the maximum page size the client may request.
193189
# Only relevant if 'page_size_query_param' has also been set.
194-
max_page_size = None
190+
# Defaults to `None`, meaning page size is unlimited.
191+
# It's recommended that you would set a limit to avoid api abuse.
192+
max_page_size = api_settings.MAX_PAGE_SIZE
195193

196194
last_page_strings = ('last',)
197195

@@ -605,7 +603,7 @@ class CursorPagination(BasePagination):
605603

606604
# Set to an integer to limit the maximum page size the client may request.
607605
# Only relevant if 'page_size_query_param' has also been set.
608-
max_page_size = None
606+
max_page_size = api_settings.MAX_PAGE_SIZE
609607

610608
# The offset in the cursor is used in situations where we have a
611609
# nearly-unique index. (Eg millisecond precision creation timestamps)

0 commit comments

Comments
 (0)