diff --git a/website/search/models.py b/website/search/models.py index 5255cbc..406b06d 100644 --- a/website/search/models.py +++ b/website/search/models.py @@ -70,6 +70,9 @@ class SearchPage(BaseContentMixin, BasePage): # type: ignore[misc] context["results"] = results else: - context["invalid_search"] = True + if "q" in request.GET: + context["invalid_search"] = True + else: + context["initial"] = True return context diff --git a/website/search/templates/search/search_page.html b/website/search/templates/search/search_page.html index 44a3fd1..e64576c 100644 --- a/website/search/templates/search/search_page.html +++ b/website/search/templates/search/search_page.html @@ -11,7 +11,9 @@ {% endif %}
- {% if invalid_search %} + {% if initial %} +

Enter search terms

+ {% elif invalid_search %}

Invalid search

{% elif results|length == 0 %} {% if page_num > paginator.num_pages %}