From 79dff1d3616546d612fdd7fa2f354eeb4ec6385a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 11 Nov 2022 17:42:29 +0100 Subject: [PATCH] add reset password link in login page --- .../templates/ereuse_devicehub/user_login.html | 3 ++- ereuse_devicehub/views.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/templates/ereuse_devicehub/user_login.html b/ereuse_devicehub/templates/ereuse_devicehub/user_login.html index f6b9a490..78776b16 100644 --- a/ereuse_devicehub/templates/ereuse_devicehub/user_login.html +++ b/ereuse_devicehub/templates/ereuse_devicehub/user_login.html @@ -21,7 +21,7 @@
-
+
Sign in
{% if form.form_errors %}

@@ -62,6 +62,7 @@

Don't have account? Create an account

+

Forgot password? Reset your password

diff --git a/ereuse_devicehub/views.py b/ereuse_devicehub/views.py index 9b35834c..89ccc6e4 100644 --- a/ereuse_devicehub/views.py +++ b/ereuse_devicehub/views.py @@ -43,10 +43,20 @@ class LoginView(View): return flask.redirect(next_url or flask.url_for('inventory.devicelist')) url_register = "#" + url_reset_password = "#" + if 'register' in app.blueprints.keys(): url_register = flask.url_for('register.user-registration') - context = {'form': form, 'version': __version__, 'url_register': url_register} + if 'reset_password' in app.blueprints.keys(): + url_reset_password = flask.url_for('reset_password.reset-password') + + context = { + 'form': form, + 'version': __version__, + 'url_register': url_register, + 'url_reset_password': url_reset_password, + } return flask.render_template(self.template_name, **context)