From e442a874217aba369efe7e20a440f74ddab023c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Wed, 5 Oct 2022 22:03:41 +0200 Subject: [PATCH] =?UTF-8?q?Pardon,=20tahle=20funkce=20brala=20n=C4=9Bco=20?= =?UTF-8?q?jin=C3=A9ho=20ne=C5=BE=20tvrdila?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vysledkovky/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vysledkovky/utils.py b/vysledkovky/utils.py index 9fead9c2..0e5a3877 100644 --- a/vysledkovky/utils.py +++ b/vysledkovky/utils.py @@ -354,14 +354,14 @@ class VysledkovkaCisla(Vysledkovka): return len(self.hlavni_problemy) - len(self.temata_a_spol) > 0 @cached_property - def podproblemy(self) -> list[list[m.Problem]]: - podproblemy = {hp.id: [] for hp in self.hlavni_problemy} - hlavni_problemy = set(self.hlavni_problemy) + def podproblemy(self) -> dict[int, list[m.Problem]]: + podproblemy = {hp.id: [] for hp in self.temata_a_spol} + temata_a_spol = set(self.temata_a_spol) podproblemy[-1] = [] for problem in self.problemy: h_problem = problem.hlavni_problem - if h_problem in hlavni_problemy: + if h_problem in temata_a_spol: podproblemy[h_problem.id].append(problem) else: podproblemy[-1].append(problem)