feat(search/views.py): search only courses
This commit is contained in:
@@ -2,6 +2,7 @@ from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
||||
from django.template.response import TemplateResponse
|
||||
|
||||
from wagtail.models import Page
|
||||
from home.models import CoursePage
|
||||
|
||||
# To enable logging of search queries for use with the "Promoted search results" module
|
||||
# <https://docs.wagtail.org/en/stable/reference/contrib/searchpromotions.html>
|
||||
@@ -20,7 +21,7 @@ def search(request):
|
||||
|
||||
# Search
|
||||
if search_query:
|
||||
search_results = Page.objects.live().search(search_query)
|
||||
search_results = CoursePage.objects.live().search(search_query)
|
||||
|
||||
# To log this query for use with the "Promoted search results" module:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user