From 61b8f1f7b9c8d0f7a644b5e1f52ad0bc8870935d Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 10 Jun 2021 11:07:54 +0200 Subject: [PATCH] =?UTF-8?q?Permet=20de=20passer=20un=20formulaire=20person?= =?UTF-8?q?nalis=C3=A9=20pour=20la=20r=C3=A9initialisation=20de=20mdp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- authens/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/authens/views.py b/authens/views.py index a1e47da..110ceaa 100644 --- a/authens/views.py +++ b/authens/views.py @@ -3,6 +3,7 @@ from urllib.parse import urlparse, urlunparse from django.conf import settings from django.contrib import auth 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.core.exceptions import PermissionDenied from django.shortcuts import redirect @@ -101,6 +102,9 @@ class PasswordResetView(SuccessMessageMixin, auth_views.PasswordResetView): subject_template_name = "authens/pwd_reset_subject.txt" success_url = reverse_lazy("authens:login") + def get_form_class(self): + return getattr(settings, "AUTHENS_PWD_RESET_FORM", PasswordResetForm) + success_message = _( "Un email de réinitialisation vient d'être envoyé à l'adresse indiquée !" )