|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
from django.shortcuts import get_object_or_404, render |
|
|
|
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, JsonResponse |
|
|
|
from django.urls import reverse |
|
|
|
from django.urls import reverse,reverse_lazy |
|
|
|
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist |
|
|
|
from django.views import generic |
|
|
|
from django.utils.translation import ugettext as _ |
|
|
@ -1281,3 +1281,32 @@ class LoginView(auth_views.LoginView): |
|
|
|
ctx = super().get_context_data(**kwargs) |
|
|
|
ctx['next'] = reverse('titulni_strana') |
|
|
|
return ctx |
|
|
|
|
|
|
|
class LogoutView(auth_views.LogoutView): |
|
|
|
# Jen vezmeme vestavěný a dáme mu vhodný template a přesměrovací URL |
|
|
|
template_name = 'seminar/logout.html' |
|
|
|
# Pavel: Vůbec nevím, proč to s _lazy funguje, ale bez toho to bylo rozbité. |
|
|
|
next_page = reverse_lazy('titulni_strana') |
|
|
|
|
|
|
|
class PasswordResetView(auth_views.PasswordResetView): |
|
|
|
#template_name = 'seminar/password_reset.html' |
|
|
|
# TODO: vlastní email_template_name a subject_template_name a html_email_template_name |
|
|
|
success_url = reverse_lazy('reset_password_done') |
|
|
|
from_email = 'login@mam.mff.cuni.cz' |
|
|
|
# TODO: přepsat User-a :-( |
|
|
|
|
|
|
|
class PasswordResetDoneView(auth_views.PasswordResetDoneView): |
|
|
|
#template_name = 'seminar/password_reset_done.html' |
|
|
|
pass |
|
|
|
|
|
|
|
class PasswordResetConfirmView(auth_views.PasswordResetConfirmView): |
|
|
|
#template_name = 'seminar/password_confirm_done.html' |
|
|
|
success_url = reverse_lazy('reset_password_complete') |
|
|
|
|
|
|
|
class PasswordResetCompleteView(auth_views.PasswordResetCompleteView): |
|
|
|
#template_name = 'seminar/password_complete_done.html' |
|
|
|
pass |
|
|
|
|
|
|
|
class PasswordChangeView(auth_views.PasswordChangeView): |
|
|
|
#template_name = 'seminar/password_change.html' |
|
|
|
success_url = reverse_lazy('titulni_strana') |
|
|
|