Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
From 740a083bf5879e37a35e510e1da789cc441040d8 Mon Sep 17 00:00:00 2001
From: Donald Buczek <buczek@molgen.mpg.de>
Date: Tue, 19 Nov 2019 15:27:16 +0100
Subject: [PATCH] Hack snippets chooser to use autocomplete
Users wanted to have partial search when Contacts are selected by the
Chooser. The Chooser doesn't have the feature to use partial matches and
our postgres_search doesn't support it in its search() method anyway.
Try to get away with changing the Chooserd to use autocomplete().
---
lib/python3.7/site-packages/wagtail/snippets/views/chooser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py b/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py
index 7c93edd..66ece97 100644
--- a/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py
+++ b/lib/python3.7/site-packages/wagtail/snippets/views/chooser.py
@@ -35,7 +35,7 @@ def choose(request, app_label, model_name):
search_query = search_form.cleaned_data['q']
search_backend = get_search_backend()
- items = search_backend.search(search_query, items)
+ items = search_backend.autocomplete(search_query, items)
is_searching = True
else:
--
2.26.2