From 50bc5f393177a4b60fda93a9c2512b6ac5242246 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Wed, 18 Nov 2020 03:41:05 +0100 Subject: [PATCH] =?UTF-8?q?=C5=98azen=C3=AD=20Non=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/odevzdavatko.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/seminar/views/odevzdavatko.py b/seminar/views/odevzdavatko.py index 318b7bae..55a12f67 100644 --- a/seminar/views/odevzdavatko.py +++ b/seminar/views/odevzdavatko.py @@ -52,7 +52,10 @@ class TabulkaOdevzdanychReseniView(ListView): tabulka[problem][resitel] = SouhrnReseni(pocet_reseni=1, posledni_odevzdani=cas, body=body) else: tabulka[problem][resitel].posledni_odevzdani = max(tabulka[problem][resitel].posledni_odevzdani, cas) - tabulka[problem][resitel].body = max(tabulka[problem][resitel].body, body) + tabulka[problem][resitel].body = max(tabulka[problem][resitel].body, body, + key=lambda x: x if x is not None else -1 # None je malé číslo + # FIXME: Možná dává smysl i mít None jako velké číslo -- jakože "TODO: zadat body" + ) tabulka[problem][resitel].pocet_reseni += 1 for hodnoceni in self.get_queryset():