|
|
@ -135,21 +135,32 @@ class KorekturyView(generic.TemplateView): |
|
|
|
|
|
|
|
# Prijemci e-mailu |
|
|
|
emails = set() |
|
|
|
# e-mail autora korektury |
|
|
|
email = oprava.autor.user.email |
|
|
|
# nalezeni e-mailu na organizatory komentaru |
|
|
|
for komentar in oprava.komentar_set.all(): |
|
|
|
email = komentar.autor.user.email |
|
|
|
if email: |
|
|
|
emails.add(email) |
|
|
|
|
|
|
|
# nalezeni e-mailu na autory komentaru |
|
|
|
for komentar in oprava.komentar_set.all(): |
|
|
|
email_komentujiciho = komentar.autor.user.email |
|
|
|
if email_komentujiciho: |
|
|
|
emails.add(email_komentujiciho) |
|
|
|
|
|
|
|
# zodpovedny org |
|
|
|
if oprava.pdf.org: |
|
|
|
email_zobpovedny = oprava.pdf.org.user.email |
|
|
|
if email_zobpovedny: |
|
|
|
emails.add(email_zobpovedny) |
|
|
|
|
|
|
|
# odstran e-mail autora opravy |
|
|
|
email = autor.user.email |
|
|
|
if email: |
|
|
|
emails.discard(email) |
|
|
|
|
|
|
|
if not settings.SEND_EMAIL_NOTIFICATIONS: |
|
|
|
print "Poslal bych upozornění na tyto adresy: ", " ".join(emails) |
|
|
|
return |
|
|
|
|
|
|
|
send_mail(subject, text, from_email, list(emails)) |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|