feat(search/views.py): search only courses

This commit is contained in:
2026-03-12 10:12:44 +01:00
parent 7de7fabf54
commit da2a5959d1

View File

@@ -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: