From e0881ed6a0205ff24d7be99a6767da3dd86fd3de Mon Sep 17 00:00:00 2001 From: sanek Date: Fri, 22 Nov 2013 18:02:35 +0400 Subject: [PATCH 1/2] Added a config parameter for change password template --- flask_security/core.py | 1 + flask_security/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flask_security/core.py b/flask_security/core.py index dfb49ac..aa8be7a 100644 --- a/flask_security/core.py +++ b/flask_security/core.py @@ -55,6 +55,7 @@ _default_config = { 'LOGIN_USER_TEMPLATE': 'security/login_user.html', 'REGISTER_USER_TEMPLATE': 'security/register_user.html', 'RESET_PASSWORD_TEMPLATE': 'security/reset_password.html', + 'CHANGE_PASSWORD_TEMPLATE': 'security/change_password.html', 'SEND_CONFIRMATION_TEMPLATE': 'security/send_confirmation.html', 'SEND_LOGIN_TEMPLATE': 'security/send_login.html', 'CONFIRMABLE': False, diff --git a/flask_security/views.py b/flask_security/views.py index b1b70df..d07bc0d 100644 --- a/flask_security/views.py +++ b/flask_security/views.py @@ -303,7 +303,7 @@ def change_password(): if request.json: return _render_json(form) - return render_template('security/change_password.html', + return render_template(config_value('CHANGE_PASSWORD_TEMPLATE'), change_password_form=form, **_ctx('change_password')) From 4549a022197a161631debcc2f9d4a1dfe09ba490 Mon Sep 17 00:00:00 2001 From: Alexander Sukharev Date: Fri, 22 Nov 2013 18:41:08 +0400 Subject: [PATCH 2/2] Added a doc entry for parameter from the previous commit --- docs/configuration.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index 816fa18..14f198b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -122,6 +122,9 @@ Template Paths ``SECURITY_RESET_PASSWORD_TEMPLATE`` Specifies the path to the template for the reset password page. Defaults to ``security/reset_password.html``. +``SECURITY_CHANGE_PASSWORD_TEMPLATE`` Specifies the path to the template for + the change password page. Defaults to + ``security/change_password.html``. ``SECURITY_SEND_CONFIRMATION_TEMPLATE`` Specifies the path to the template for the resend confirmation instructions page. Defaults to