diff --git a/api/views/autocomplete.py b/api/views/autocomplete.py index 8c6f334c..33e083eb 100644 --- a/api/views/autocomplete.py +++ b/api/views/autocomplete.py @@ -72,9 +72,9 @@ class ProblemAutocomplete(autocomplete.Select2QuerySetView): # FIXME i starší úlohy nastaveni = get_object_or_404(m.Nastaveni) rocnik = nastaveni.aktualni_rocnik - temaQ = Q(Tema___rocnik = rocnik, stav=m.Problem.STAV_ZADANY) - ulohaQ = Q(Uloha___cislo_zadani__rocnik = rocnik, stav=m.Problem.STAV_ZADANY) - clanekQ = Q(Clanek___cislo__rocnik = rocnik, stav=m.Problem.STAV_ZADANY) + temaQ = Q(Tema___rocnik = rocnik) + ulohaQ = Q(Uloha___cislo_zadani__rocnik=rocnik) + clanekQ = Q(Clanek___cislo__rocnik=rocnik) qs = m.Problem.objects.filter(temaQ | ulohaQ | clanekQ).order_by("-stav", "nazev") if self.q: qs = qs.filter(