From 33ce4a5db5c715aad8fa372ba0056e152516e0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 15 Nov 2021 22:05:30 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20autocomplete=20um=C3=ADraj=C3=ADc=C3=AD?= =?UTF-8?q?=20na=20mezeru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/views/autocomplete.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/views/autocomplete.py b/api/views/autocomplete.py index 98087cc8..630e9106 100644 --- a/api/views/autocomplete.py +++ b/api/views/autocomplete.py @@ -13,7 +13,9 @@ class SkolaAutocomplete(autocomplete.Select2QuerySetView): if self.q: words = self.q.split(' ') #TODO re split podle bileho znaku partq = Q() - for w in words: # Hledej po slovech, zahoď čárky a tečky z konců. + for w in words: # Hledej po slovech, zahoď čárky a tečky z konců. + if len(w) == 0: + continue if w[-1] in (".",","): w = w[:-1]