mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
Merge pull request #187 from surfstudio/change_password_config_fix
Added a config parameter for change password template
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user