Add A2_RESET_PASSWORD_ID_LABEL parameter (#49131)
This commit is contained in:
parent
fd248ebb89
commit
1f2ea15580
|
@ -139,6 +139,9 @@ default_settings = dict(
|
|||
A2_USER_CAN_RESET_PASSWORD=Setting(
|
||||
default=None,
|
||||
definition='Allow online reset of passwords'),
|
||||
A2_RESET_PASSWORD_ID_LABEL=Setting(
|
||||
default=None,
|
||||
definition='Alternate ID label for the password reset form'),
|
||||
A2_EMAIL_IS_UNIQUE=Setting(
|
||||
default=False,
|
||||
definition='Email of users must be unique'),
|
||||
|
|
|
@ -655,6 +655,13 @@ class PasswordResetView(FormView):
|
|||
'registration/password_reset_form.html',
|
||||
]
|
||||
|
||||
def get_form(self, **kwargs):
|
||||
"""Return an instance of the form to be used in this view."""
|
||||
form = super(PasswordResetView, self).get_form(**kwargs)
|
||||
if app_settings.A2_RESET_PASSWORD_ID_LABEL:
|
||||
form.fields['email'].label = app_settings.A2_RESET_PASSWORD_ID_LABEL
|
||||
return form
|
||||
|
||||
def get_form_kwargs(self, **kwargs):
|
||||
kwargs = super(PasswordResetView, self).get_form_kwargs(**kwargs)
|
||||
initial = kwargs.setdefault('initial', {})
|
||||
|
|
Loading…
Reference in New Issue