From d2afe5be0c6ef70340cbda915e04cd0f3dcc5156 Mon Sep 17 00:00:00 2001 From: MaM Web user Date: Sat, 4 Sep 2021 22:05:35 +0200 Subject: [PATCH] =?UTF-8?q?Maily=20o=20do=C5=A1l=C3=BDch=20=C5=99e=C5=A1en?= =?UTF-8?q?=C3=ADch:=20m=C3=A9n=C4=9B=20padat,=20v=C3=ADce=20hl=C3=A1sit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/views_all.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index e0b918fb..30a7f681 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -1085,9 +1085,12 @@ class NahrajReseniView(LoginRequiredMixin, CreateView): problemy = [] for prob in form.cleaned_data['problem']: prijemci.update(prob.opravovatele.all()) - prijemci.add(prob.garant) + if prob.garant is not None: + prijemci.add(prob.garant) problemy.append(prob) # FIXME: Možná poslat mail i relevantním orgům nadproblémů? + if len(prijemci) < 1: + logger.warning(f"Pozor, neposílám e-mail nikomu. Problémy: {problemy}") # FIXME: Víc informativní obsah mailů, možná vč. příloh? prijemci = map(lambda it: it.osoba.email, prijemci)