From 8e47df286574f2029c67c937ecdec0598154ce53 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Wed, 30 Jun 2021 04:03:57 +0200 Subject: [PATCH] =?UTF-8?q?Lep=C5=A1=C3=AD=20"Moje=20probl=C3=A9my"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/views_all.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 5c51c517..a05ac356 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -846,17 +846,17 @@ class OrgoRozcestnikView(TemplateView): u = self.request.user os = s.Osoba.objects.get(user=u) organizator = s.Organizator.objects.get(osoba=os) - temata_garant = s.Tema.objects.filter(garant=organizator, - rocnik=aktualni_rocnik) - #FIXME: přidat opravovatel, stav='STAV_ZADANY' - ulohy_garant = s.Uloha.objects.filter(garant=organizator, - cislo_zadani__rocnik=aktualni_rocnik) - clanky_garant = s.Clanek.objects.filter(garant=organizator, - cislo__rocnik=aktualni_rocnik) - - context['temata'] = temata_garant - context['ulohy'] = ulohy_garant - context['clanky'] = clanky_garant + #FIXME: přidat stav='STAV_ZADANY' + temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]), + rocnik=aktualni_rocnik).distinct() + ulohy = s.Uloha.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]), + cislo_zadani__rocnik=aktualni_rocnik).distinct() + clanky = s.Clanek.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]), + cislo__rocnik=aktualni_rocnik).distinct() + + context['temata'] = temata + context['ulohy'] = ulohy + context['clanky'] = clanky context['organizator'] = organizator return context