|
|
@ -35,7 +35,7 @@ class KorekturyView(generic.TemplateView): |
|
|
|
# prirazeni autora podle prihlaseni |
|
|
|
autor_user = request.user |
|
|
|
# pokud existuje ucet (user), ale neni to organizator = 403 |
|
|
|
autor = Organizator.objects.filter(user=autor_user).first() |
|
|
|
autor = Organizator.objects.filter(osoba__user=autor_user).first() |
|
|
|
if not autor: |
|
|
|
return HttpResponseForbidden() |
|
|
|
|
|
|
@ -133,24 +133,24 @@ class KorekturyView(generic.TemplateView): |
|
|
|
# Prijemci e-mailu |
|
|
|
emails = set() |
|
|
|
# e-mail autora korektury |
|
|
|
email = oprava.autor.user.email |
|
|
|
email = oprava.autor.osoba.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 |
|
|
|
email_komentujiciho = komentar.autor.osoba.email |
|
|
|
if email_komentujiciho: |
|
|
|
emails.add(email_komentujiciho) |
|
|
|
|
|
|
|
# zodpovedny org |
|
|
|
if oprava.pdf.org: |
|
|
|
email_zobpovedny = oprava.pdf.org.user.email |
|
|
|
email_zobpovedny = oprava.pdf.org.osoba.email |
|
|
|
if email_zobpovedny: |
|
|
|
emails.add(email_zobpovedny) |
|
|
|
|
|
|
|
# odstran e-mail autora opravy |
|
|
|
email = autor.user.email |
|
|
|
email = autor.osoba.email |
|
|
|
if email: |
|
|
|
emails.discard(email) |
|
|
|
|
|
|
|