From ea3050c50942290ce9280ca24cd95e193e9da624 Mon Sep 17 00:00:00 2001 From: Jonas Havelka Date: Tue, 15 Jun 2021 22:17:36 +0200 Subject: [PATCH] =?UTF-8?q?h.body=20m=C5=AF=C5=BEou=20b=C3=BDt=20i=20None?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/models.py b/seminar/models.py index f7c6ec46..0adf5331 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -312,7 +312,7 @@ class Resitel(SeminarModelBase): vsechna_reseni = self.reseni_set.all() vsechna_hodnoceni = Hodnoceni.objects.filter( reseni__in=vsechna_reseni) - return sum(h.body for h in list(vsechna_hodnoceni)) + return sum(h.body for h in list(vsechna_hodnoceni) if h is not None) def get_titul(self, body=None): @@ -360,7 +360,7 @@ class Resitel(SeminarModelBase): novejsi_hodnoceni = Hodnoceni.objects.filter(reseni__in=self.reseni_set.all()).difference(hodnoceni_do_25_rocniku) def body_z_hodnoceni(hh : list): - return sum(h.body for h in hh) + return sum(h.body for h in hh if h is not None) stare_body = body_z_hodnoceni(hodnoceni_do_25_rocniku) if body is None: