diff mbox

REST: Limit max page size

Message ID 20170207214635.29715-1-stephen@that.guru
State Accepted
Headers show

Commit Message

Stephen Finucane Feb. 7, 2017, 9:46 p.m. UTC
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>
---
 patchwork/api/base.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Doan Feb. 24, 2017, 3:35 a.m. UTC | #1
On 02/07/2017 03:46 PM, Stephen Finucane wrote:
> 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>
diff mbox

Patch

diff --git a/patchwork/api/base.py b/patchwork/api/base.py
index 13a8432..7dd9de2 100644
--- a/patchwork/api/base.py
+++ b/patchwork/api/base.py
@@ -37,7 +37,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):