diff options
| author | Leo Mouyna <mouynaleo@gmail.com> | 2019-09-12 21:38:52 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2019-09-16 21:35:28 +0200 |
| commit | db9801069115a7a0c237c2c7de15d0f7e144b306 (patch) | |
| tree | cd063edcc16f9c7baa8e4e5680c5882202394add /ihatemoney/web.py | |
| parent | 33d497aac27f594ab52809e7dab9ed00814b9d79 (diff) | |
| download | ihatemoney-mirror-db9801069115a7a0c237c2c7de15d0f7e144b306.zip ihatemoney-mirror-db9801069115a7a0c237c2c7de15d0f7e144b306.tar.gz ihatemoney-mirror-db9801069115a7a0c237c2c7de15d0f7e144b306.tar.bz2 | |
fix: display validation message on password reminder
Create a new route with a new generic page that display a title and a message on a <p> tag. This route will be triggered after succesfully submit password reminder form
See issue #455
Diffstat (limited to 'ihatemoney/web.py')
| -rw-r--r-- | ihatemoney/web.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ihatemoney/web.py b/ihatemoney/web.py index 8ab3217..1e1a72f 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -271,18 +271,23 @@ def remind_password(): if form.validate(): # get the project project = Project.query.get(form.id.data) - # send a link to reset the password password_reminder = "password_reminder.%s.j2" % get_locale().language current_app.mail.send(Message( "password recovery", body=render_template(password_reminder, project=project), recipients=[project.contact_email])) - flash(_("A link to reset your password has been sent to your email.")) + return redirect(url_for(".password_reminder_sent")) return render_template("password_reminder.html", form=form) +@main.route("/password-reminder-sent", methods=["GET"]) +def password_reminder_sent(): + message = "A link to reset your password has been sent to you, please check your emails" + return render_template("display_message.html", title="Password reminder", message=message) + + @main.route('/reset-password', methods=['GET', 'POST']) def reset_password(): form = ResetPasswordForm() |
