Skip to content
Snippets Groups Projects
Commit c02da0f0 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Limit the search to only pages on the public site

Hides the fund forms and the round pages
parent 9898f1d4
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ from django.shortcuts import render
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.models import Query
from opentech.public.home.models import HomePage
def search(request):
search_query = request.GET.get('query', None)
......@@ -11,7 +13,8 @@ def search(request):
# Search
if search_query:
search_results = Page.objects.live().search(search_query, operator='and')
public_site = HomePage.objects.first()
search_results = Page.objects.live().child_of(public_site).search(search_query, operator='and')
query = Query.get(search_query)
# Record hit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment