From bb75e8436a5405b36d558052ca31a5dc25288ea8 Mon Sep 17 00:00:00 2001
From: MaM Web user <mam-web@gimli.ms.mff.cuni.cz>
Date: Thu, 2 Sep 2021 20:37:42 +0200
Subject: [PATCH] =?UTF-8?q?Pokus=20o=20debug=20#1211,=20st=C5=99edn=C4=9B?=
 =?UTF-8?q?=20ne=C3=BAsp=C4=9B=C5=A1n=C3=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 seminar/views/autocomplete.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/seminar/views/autocomplete.py b/seminar/views/autocomplete.py
index 699a260e..f63ab5ac 100644
--- a/seminar/views/autocomplete.py
+++ b/seminar/views/autocomplete.py
@@ -36,9 +36,13 @@ class OdevzdatelnyProblemAutocomplete(autocomplete.Select2QuerySetView):
 		temata = m.Tema.objects.filter(rocnik=rocnik, stav=m.Problem.STAV_ZADANY)
 		ulohy = m.Uloha.objects.filter(cislo_deadline__rocnik = rocnik)
 		clanky = m.Clanek.objects.filter(cislo__rocnik = rocnik, stav=m.Problem.STAV_ZADANY) # FIXME: Je tohle to, co chceme?
-		ulohy.union(temata)
-		ulohy.union(clanky)
+		print(temata, ulohy, clanky)
+		ulohy.union(temata, all=True)
+		print(ulohy)
+		ulohy.union(clanky, all=True)
+		print(ulohy)
 		qs = ulohy
+		print(qs)
 		if self.q:
 			qs = qs.filter(
 					Q(nazev__startswith=self.q))