diff --git a/orp/orp_search/views.py b/orp/orp_search/views.py index 1ea7e50..758c496 100644 --- a/orp/orp_search/views.py +++ b/orp/orp_search/views.py @@ -4,7 +4,7 @@ from django.conf import settings from django.http import HttpRequest, HttpResponse -from django.shortcuts import render +from django.shortcuts import redirect, render from django.views.decorators.http import require_http_methods from core.forms import RegulationSearchForm @@ -63,6 +63,9 @@ def search(request: HttpRequest) -> HttpResponse: during the Data API search, the service problem page is displayed. """ + if "query" not in request.GET: + return redirect("/?query=") + context = { "service_name": settings.SERVICE_NAME_SEARCH, }