users: Clarify help message for authorization password

Closes: #2081.

Tests:

- In the create user form, edit user form and change password form, the message
is shown as expected.

- The create user form, edit user form and change password form work as expected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-01-25 20:56:08 -08:00 committed by James Valleroy
parent 5ff7339c19
commit 136e70bbd0
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -75,8 +75,14 @@ class PasswordConfirmForm(forms.Form):
"""Password confirmation form."""
confirm_password = forms.CharField(
widget=forms.PasswordInput,
label=gettext_lazy('Authorization Password'), help_text=gettext_lazy(
'Enter your current password to authorize account modifications.'))
label=gettext_lazy('Authorization Password'))
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['confirm_password'].help_text = _(
'Enter the password for user "{user}" to authorize account '
'modifications.').format(user=self.request.user.username)
def clean_confirm_password(self):
"""Check that current user's password matches."""