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