Web M&M
https://mam.matfyz.cz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.6 KiB
46 lines
1.6 KiB
3 years ago
|
from django.urls import reverse_lazy
|
||
|
from django.contrib.auth import views as auth_views
|
||
|
|
||
|
|
||
|
class LoginView(auth_views.LoginView):
|
||
|
# Jen vezmeme vestavěný a dáme mu vhodný template a přesměrovací URL
|
||
|
template_name = 'autentizace/login.html'
|
||
|
|
||
|
|
||
|
class LogoutView(auth_views.LogoutView):
|
||
|
# Jen vezmeme vestavěný a dáme mu vhodný template a přesměrovací URL
|
||
|
template_name = 'autentizace/logout.html'
|
||
|
# Pavel: Vůbec nevím, proč to s _lazy funguje, ale bez toho to bylo rozbité.
|
||
|
next_page = reverse_lazy('titulni_strana')
|
||
|
|
||
|
|
||
|
# Nejsem si jistý, který view co dostává, tak zahazuji všechny POSTy
|
||
|
class PasswordResetView(auth_views.PasswordResetView):
|
||
|
""" Chci resetovat heslo. """
|
||
|
template_name = 'autentizace/reset_hesla.html'
|
||
|
success_url = reverse_lazy('reset_password_done')
|
||
|
from_email = 'login@mam.mff.cuni.cz'
|
||
|
email_template_name = 'autentizace/password_reset_email.html'
|
||
|
subject_template_name = 'autentizace/password_reset_subject.txt'
|
||
|
|
||
|
|
||
|
class PasswordResetDoneView(auth_views.PasswordResetDoneView):
|
||
|
""" Poslali jsme e-mail (pokud bylo kam)). """
|
||
|
template_name = 'autentizace/reset_poslan.html'
|
||
|
|
||
|
|
||
|
class PasswordResetConfirmView(auth_views.PasswordResetConfirmView):
|
||
|
""" Vymysli si heslo. """
|
||
|
template_name = 'autentizace/nove_heslo.html'
|
||
|
success_url = reverse_lazy('reset_password_complete')
|
||
|
|
||
|
|
||
|
class PasswordResetCompleteView(auth_views.PasswordResetCompleteView):
|
||
|
""" Heslo se asi změnilo."""
|
||
|
template_name = 'autentizace/nove_nastaveno.html'
|
||
|
|
||
|
|
||
|
class PasswordChangeView(auth_views.PasswordChangeView):
|
||
|
# template_name = 'seminar/password_change.html'
|
||
|
success_url = reverse_lazy('titulni_strana')
|