From 7b44da77383efc9a3c4daf9b0fff16071c3fce68 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Sun, 2 Oct 2016 11:57:11 +0200 Subject: [PATCH] korekrury | oprava kdyz zodpovedny org neexistuje --- korektury/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/korektury/views.py b/korektury/views.py index ccc224f4..66d87a30 100644 --- a/korektury/views.py +++ b/korektury/views.py @@ -145,9 +145,10 @@ class KorekturyView(generic.TemplateView): if email: emails.add(email) # zodpovedny org - email_zobpovedny = oprava.pdf.org.user.email - if email_zobpovedny: - emails.add(email_zobpovedny) + if oprava.pdf.org: + email_zobpovedny = oprava.pdf.org.user.email + if email_zobpovedny: + emails.add(email_zobpovedny) send_mail(subject, text, from_email, list(emails))