From dd49c0e1ba65a51cc8da54f35e52ed0ed476f850 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 22 May 2023 21:47:27 +0200 Subject: [PATCH] =?UTF-8?q?Mal=C3=A1=20=C3=BAprava=20TabulkaOdevzdanychRes?= =?UTF-8?q?eniView.get=5Fcontext=5Fdata.pridej=5Freseni?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/odevzdavatko/views.py b/odevzdavatko/views.py index 684b790b..6d8013ca 100644 --- a/odevzdavatko/views.py +++ b/odevzdavatko/views.py @@ -127,7 +127,10 @@ class TabulkaOdevzdanychReseniView(ListView): ctx['resitele'] = self.resitele tabulka: dict[m.Problem, dict[m.Resitel, SouhrnReseni]] = dict() - def pridej_reseni(problem, resitel, body, cas): + def pridej_reseni(resitel, hodnoceni): + problem = hodnoceni.problem + body = hodnoceni.body + cas = hodnoceni.reseni.cas_doruceni if problem not in tabulka: tabulka[problem] = dict() if resitel not in tabulka[problem]: @@ -143,7 +146,7 @@ class TabulkaOdevzdanychReseniView(ListView): for hodnoceni in self.get_queryset(): for resitel in hodnoceni.reseni.resitele.all(): - pridej_reseni(hodnoceni.problem, resitel, hodnoceni.body, hodnoceni.reseni.cas_doruceni) + pridej_reseni(resitel, hodnoceni) hodnoty: list[list[SouhrnReseni]] = [] resitele_do_tabulky: list[m.Resitel] = []