From 750ed5aa394c520a58e2f4a784e8a38e23594905 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 1 Aug 2022 21:27:40 +0100 Subject: [PATCH] Remove unnecessary method --- website/search/models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/search/models.py b/website/search/models.py index a2e9dbc..1da04ac 100644 --- a/website/search/models.py +++ b/website/search/models.py @@ -38,9 +38,6 @@ class SearchPage(BaseContentMixin, RoutablePageMixin, BasePage): # type: ignore def table_of_contents(self) -> list[TocEntry]: return [] - def get_search_pages(self) -> PageQuerySet: - return Page.objects.live().not_type(self.__class__, HomePage) - def get_context(self, request: HttpRequest) -> dict: context = super().get_context(request) context["search_query"] = request.GET.get("q", "") @@ -68,7 +65,7 @@ class SearchPage(BaseContentMixin, RoutablePageMixin, BasePage): # type: ignore filters, query = parse_query_string(search_query) Query.get(search_query).add_hit() - pages = self.get_search_pages().search(query) + pages = Page.objects.live().not_type(self.__class__, HomePage).search(query) paginator = Paginator(pages, self.PAGE_SIZE) context["paginator"] = paginator