From 158ba9cbfcddfdfd3337570bded055fdc4a5b16a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 6 Oct 2023 21:23:32 +0100 Subject: [PATCH] Increase page sizes --- website/api/pagination.py | 4 ++-- website/common/models.py | 2 +- website/search/models.py | 2 +- website/search/tests.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/api/pagination.py b/website/api/pagination.py index f023baf..db74939 100644 --- a/website/api/pagination.py +++ b/website/api/pagination.py @@ -2,5 +2,5 @@ from rest_framework.pagination import PageNumberPagination class CustomPageNumberPagination(PageNumberPagination): - page_size = 10 - max_page_size = 30 + page_size = 15 + max_page_size = 40 diff --git a/website/common/models.py b/website/common/models.py index 6088649..b1ffc02 100644 --- a/website/common/models.py +++ b/website/common/models.py @@ -216,7 +216,7 @@ class ContentPage(BaseContentPage): class BaseListingPage(RoutablePageMixin, BaseContentPage): - PAGE_SIZE = 20 + PAGE_SIZE = 30 subtitle = None content_panels = [ diff --git a/website/search/models.py b/website/search/models.py index 6d33851..1dcbe64 100644 --- a/website/search/models.py +++ b/website/search/models.py @@ -19,7 +19,7 @@ class SearchPage(RoutablePageMixin, BaseContentPage): max_count = 1 subpage_types: list = [] parent_page_types = ["home.HomePage"] - PAGE_SIZE = 10 + PAGE_SIZE = 12 # Exclude singleton pages from search results EXCLUDED_PAGE_TYPES = {page for page in get_page_models() if page.max_count == 1} diff --git a/website/search/tests.py b/website/search/tests.py index 01f51fa..6a85c60 100644 --- a/website/search/tests.py +++ b/website/search/tests.py @@ -89,9 +89,9 @@ class SearchPageResultsTestCase(TestCase): ) def test_too_high_page(self) -> None: - with self.assertNumQueries(47): + with self.assertNumQueries(49): response = self.client.get( - self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true" + self.url, {"q": "post", "page": 30}, HTTP_HX_REQUEST="true" ) self.assertEqual(response.status_code, 404)