From 6a63201fd4d84a1d1daf8a2098d31943c6306b23 Mon Sep 17 00:00:00 2001 From: David McKee Date: Tue, 25 Apr 2023 13:02:15 +0100 Subject: [PATCH] Require query default value to be empty string, not None This was causing the following error: https://app.rollbar.com/a/dxw/fix/item/tna-caselaw-public-ui/166 --- judgments/views/advanced_search.py | 2 +- judgments/views/results.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/judgments/views/advanced_search.py b/judgments/views/advanced_search.py index 340a759ee..75a68730f 100644 --- a/judgments/views/advanced_search.py +++ b/judgments/views/advanced_search.py @@ -20,7 +20,7 @@ def advanced_search(request): params = request.GET query_params = { - "query": params.get("query"), + "query": params.get("query", ""), "court": params.getlist("court"), "judge": params.get("judge"), "party": params.get("party"), diff --git a/judgments/views/results.py b/judgments/views/results.py index 5f5b87608..ce582d284 100644 --- a/judgments/views/results.py +++ b/judgments/views/results.py @@ -22,7 +22,7 @@ def results(request): context = {"page_title": gettext("results.search.title")} try: params = request.GET - query = preprocess_query(params.get("query")) + query = preprocess_query(params.get("query", "")) page = str(as_integer(params.get("page"), minimum=1)) per_page = str( as_integer(