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]