Commit 171a9078 authored by Adrien Di Mascio's avatar Adrien Di Mascio
Browse files

provide an easy-to-override pwdsent view, called after password is reset

parent e41dc4f04b9f
......@@ -143,7 +143,7 @@ class ForgottenPasswordRequestConfirm(controller.Controller):
def publish(self, rset=None):
data = self.checked_data()
msg = self.appli.repo.forgotpwd_change_passwd(data)
raise Redirect(self.build_url('', __message=msg))
raise Redirect(self.build_url('pwdreset', __message=msg))
def checked_data(self):
fieldsform = self.vreg['forms'].select('forgottenpasswordrequest', self.req)
......@@ -164,6 +164,13 @@ class ForgottenPasswordRequestConfirm(controller.Controller):
return data
class PasswordResetView(StartupView):
id = 'pwdreset'
def call(self):
self.wview('index', self.rset)
# Monkey Patching
# ---------------
......@@ -171,7 +178,6 @@ from cubicweb.server.repository import Repository
from logilab.common.decorators import monkeypatch
from cubicweb.common.mail import format_mail
def forgotpwd_send_email(self, data):
session = self.internal_session()
......@@ -238,4 +244,5 @@ class RegistrationSimpleReqRewriter(urlrewrite.SimpleReqRewriter):
('/forgottenpassword', dict(vid='forgottenpassword')),
('/forgottenpasswordrequest', dict(vid='forgottenpasswordrequest')),
('/pwdsent', dict(vid='pwdsent')),
('/pwdreset', dict(vid='pwdreset')),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment