]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
REST: Limit max page size
authorStephen Finucane <stephen@that.guru>
Tue, 7 Feb 2017 21:46:35 +0000 (21:46 +0000)
committerStephen Finucane <stephen@that.guru>
Wed, 1 Mar 2017 22:10:57 +0000 (22:10 +0000)
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 <stephen@that.guru>
Cc: Andy Doan <andy.doan@linaro.org>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
patchwork/api/base.py

index dbd8148d033f3563162ae5c1865dd55f68051b5d..0797990596ba4800bcce98058e54f18d099906c8 100644 (file)
@@ -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):