diff --git a/api/views/autocomplete.py b/api/views/autocomplete.py index 601f4e35..84a915bf 100644 --- a/api/views/autocomplete.py +++ b/api/views/autocomplete.py @@ -37,9 +37,9 @@ class ResitelAutocomplete(LoginRequiredAjaxMixin,autocomplete.Select2QuerySetVie query = Q() for part in parts: query &= ( - Q(osoba__jmeno__istartswith=self.q)| - Q(osoba__prijmeni__istartswith=self.q)| - Q(osoba__prezdivka__istartswith=self.q) + Q(osoba__jmeno__istartswith=part)| + Q(osoba__prijmeni__istartswith=part)| + Q(osoba__prezdivka__istartswith=part) ) qs = qs.filter(query) return qs