mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
Set a default max_limit based on api_settings
With a default of `None`, this can allow for some scary requests, even when `MAX_PAGINATE_BY` is set. If we set `max_limit` to the global default, the behaviour is more predictable.
This commit is contained in:
parent
cab981837f
commit
cdfcdf4772
|
@ -341,7 +341,7 @@ class LimitOffsetPagination(BasePagination):
|
||||||
default_limit = api_settings.PAGE_SIZE
|
default_limit = api_settings.PAGE_SIZE
|
||||||
limit_query_param = 'limit'
|
limit_query_param = 'limit'
|
||||||
offset_query_param = 'offset'
|
offset_query_param = 'offset'
|
||||||
max_limit = None
|
max_limit = api_settings.MAX_PAGINATE_BY
|
||||||
template = 'rest_framework/pagination/numbers.html'
|
template = 'rest_framework/pagination/numbers.html'
|
||||||
|
|
||||||
def paginate_queryset(self, queryset, request, view=None):
|
def paginate_queryset(self, queryset, request, view=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user