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:
Daniel Quinn 2015-07-20 16:04:20 +02:00
parent cab981837f
commit cdfcdf4772

View File

@ -341,7 +341,7 @@ class LimitOffsetPagination(BasePagination):
default_limit = api_settings.PAGE_SIZE
limit_query_param = 'limit'
offset_query_param = 'offset'
max_limit = None
max_limit = api_settings.MAX_PAGINATE_BY
template = 'rest_framework/pagination/numbers.html'
def paginate_queryset(self, queryset, request, view=None):