From: Stephen Finucane Date: Tue, 7 Feb 2017 21:46:35 +0000 (+0000) Subject: REST: Limit max page size X-Git-Tag: v2.0.0-rc1~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41790caf59ad;p=thirdparty%2Fpatchwork.git REST: Limit max page size If this isn't set it's possible to set any page size. Let's restrict this to the value set in settings. Signed-off-by: Stephen Finucane Cc: Andy Doan Reviewed-by: Andy Doan --- diff --git a/patchwork/api/base.py b/patchwork/api/base.py index dbd8148d..07979905 100644 --- a/patchwork/api/base.py +++ b/patchwork/api/base.py @@ -32,7 +32,7 @@ class LinkHeaderPagination(PageNumberPagination): https://tools.ietf.org/html/rfc5988#section-5 https://developer.github.com/guides/traversing-with-pagination """ - page_size = settings.REST_RESULTS_PER_PAGE + page_size = max_page_size = settings.REST_RESULTS_PER_PAGE page_size_query_param = 'per_page' def get_paginated_response(self, data):