Permet de passer un formulaire personnalisé pour la réinitialisation de mdp
This commit is contained in:
parent
f24395ea41
commit
61b8f1f7b9
1 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,7 @@ from urllib.parse import urlparse, urlunparse
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import auth
|
from django.contrib import auth
|
||||||
from django.contrib.auth import views as auth_views
|
from django.contrib.auth import views as auth_views
|
||||||
|
from django.contrib.auth.forms import PasswordResetForm
|
||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
|
@ -101,6 +102,9 @@ class PasswordResetView(SuccessMessageMixin, auth_views.PasswordResetView):
|
||||||
subject_template_name = "authens/pwd_reset_subject.txt"
|
subject_template_name = "authens/pwd_reset_subject.txt"
|
||||||
success_url = reverse_lazy("authens:login")
|
success_url = reverse_lazy("authens:login")
|
||||||
|
|
||||||
|
def get_form_class(self):
|
||||||
|
return getattr(settings, "AUTHENS_PWD_RESET_FORM", PasswordResetForm)
|
||||||
|
|
||||||
success_message = _(
|
success_message = _(
|
||||||
"Un email de réinitialisation vient d'être envoyé à l'adresse indiquée !"
|
"Un email de réinitialisation vient d'être envoyé à l'adresse indiquée !"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue