From e7db79d387c24c2ca0e41f6dd064a22a25fa5954 Mon Sep 17 00:00:00 2001 From: Julian Dehm Date: Tue, 31 Oct 2023 09:59:39 +0100 Subject: [PATCH] apps/contrib: fix error when switching language on search page --- apps/contrib/views.py | 2 +- changelog/_0001.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/_0001.md diff --git a/apps/contrib/views.py b/apps/contrib/views.py index 3da040eb..b9b15f3c 100644 --- a/apps/contrib/views.py +++ b/apps/contrib/views.py @@ -10,6 +10,6 @@ class SearchResultsView(ListView): def get_queryset(self): sb = get_search_backend() - query = self.request.GET.get('q') + query = self.request.GET.get('q', '') res = sb.autocomplete(query, Page, fields=get_search_fields()) return res diff --git a/changelog/_0001.md b/changelog/_0001.md new file mode 100644 index 00000000..67686aa8 --- /dev/null +++ b/changelog/_0001.md @@ -0,0 +1,3 @@ +### Fixed + +- error when switching language on search page