From 136e70bbd06adb0d567306f50e6dae8008f770b7 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 25 Jan 2022 20:56:08 -0800 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/modules/users/forms.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plinth/modules/users/forms.py b/plinth/modules/users/forms.py index aa310ab44..61814b5c5 100644 --- a/plinth/modules/users/forms.py +++ b/plinth/modules/users/forms.py @@ -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."""