From ea7075f707bcc74a28379232fad381ed10e145ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 2 Jan 2023 21:09:56 +0100 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=C5=99azen=C3=AD=20=C5=99e=C5=A1itel?= =?UTF-8?q?=C5=AF=20v=20odm=C4=9Bn=C3=A1ch=20podle=20p=C5=99=C3=ADjmen?= =?UTF-8?q?=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/views_all.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 3f2cdf01..01c561eb 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -450,9 +450,9 @@ class OdmenyView(generic.TemplateView): frombody = body_resitelu(resitele=resitele, jen_verejne=False, do=from_deadline) tobody = body_resitelu(resitele=resitele, jen_verejne=False, do=to_deadline) outlist = [] - for (aid, tbody) in tobody.items(): - fbody = frombody.get(aid,0) - resitel = Resitel.objects.get(pk=aid) + for resitel in resitele: + fbody = frombody.get(resitel.id, 0) + tbody = tobody.get(resitel.id, 0) ftitul = resitel.get_titul(fbody) ttitul = resitel.get_titul(tbody) if ftitul != ttitul: -- 2.39.5 From 72b72899fdbf1423b2b6c753c0d0c07d67aae8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 2 Jan 2023 21:20:00 +0100 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20odm=C4=9Bny=20maj=C3=AD=20h=C3=A1zet?= =?UTF-8?q?=20alespo=C5=88=20404=20na=20=C5=A1patn=C3=A9=20=C4=8D=C3=ADslo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/views_all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 01c561eb..16f8ae55 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -442,8 +442,8 @@ class OdmenyView(generic.TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - fromcislo = Cislo.objects.get(rocnik=self.kwargs.get('frocnik'), poradi=self.kwargs.get('fcislo')) - tocislo = Cislo.objects.get(rocnik=self.kwargs.get('trocnik'), poradi=self.kwargs.get('tcislo')) + fromcislo = get_object_or_404(Cislo, rocnik=self.kwargs.get('frocnik'), poradi=self.kwargs.get('fcislo')) + tocislo = get_object_or_404(Cislo, rocnik=self.kwargs.get('trocnik'), poradi=self.kwargs.get('tcislo')) resitele = aktivniResitele(tocislo) def get_diff(from_deadline: Deadline, to_deadline: Deadline): -- 2.39.5