From 79fea4074e18a9521a5af01c0696ebcd16e7f523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 24 Nov 2022 20:44:15 +0100 Subject: [PATCH] =?UTF-8?q?hotfix:=20kruci,=20kop=C3=ADrov=C3=A1n=C3=AD=20?= =?UTF-8?q?je=20=C4=8Dast=C3=BDm=20zdrojem=20chyb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/views/autocomplete.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(