From 305b1f01f56bf5c87b7d33a805c3b494588f17f2 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 4 Feb 2026 16:24:19 -0800 Subject: [PATCH] backups: Avoid some repeated text in form help text Tests: - The remote repository add form shows form elements are updated as expected. Signed-off-by: Sunil Mohan Adapa --- plinth/modules/backups/forms.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/plinth/modules/backups/forms.py b/plinth/modules/backups/forms.py index e118b7eeb..faf5e0e2e 100644 --- a/plinth/modules/backups/forms.py +++ b/plinth/modules/backups/forms.py @@ -253,31 +253,27 @@ class AddRemoteRepositoryForm(EncryptedBackupsMixin, forms.Form): validators=[repository_validator]) ssh_auth_type = forms.ChoiceField( label=_('SSH Authentication Type'), - help_text=_('How to authenticate to the remote SSH server.
' - 'If Key-based Authentication is selected, then the ' - "FreedomBox service's SSH client public key must be added" - " to the authorized keys list on the remote server.
" - 'If Password-based Authentication is selected, then ' - 'FreedomBox will attempt to copy its SSH client public ' - 'key to the remote server.'), widget=forms.RadioSelect(), + help_text=_('Choose how to authenticate to the remote SSH server.'), + widget=forms.RadioSelect(), choices=[('key_auth', _('Key-based Authentication')), ('password_auth', _('Password-based Authentication'))]) ssh_password = forms.CharField( label=_('SSH server password'), widget=forms.PasswordInput(), - strip=True, - help_text=_('Required only for password-based authentication.'), + strip=True, help_text=_('Required for password-based authentication.'), required=False) field_order = ['repository', 'ssh_auth_type', 'ssh_password' ] + encryption_fields def clean(self): + """Perform additional checks on form data.""" super().clean() ssh_password = self.cleaned_data.get('ssh_password') if self.cleaned_data.get( 'ssh_auth_type') == 'password_auth' and not ssh_password: raise forms.ValidationError( _('SSH password is needed for password-based authentication.')) + return self.cleaned_data def clean_repository(self):