backups: Require passphrase for encryption in add repository form

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
Sunil Mohan Adapa 2019-06-24 16:49:32 -07:00 committed by Joseph Nuthalapati
parent 2a2cc41f1d
commit f2ea0b9065
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35

View File

@ -161,6 +161,10 @@ class AddRepositoryForm(forms.Form):
raise forms.ValidationError(
_('The entered encryption passphrases do not match'))
if self.cleaned_data.get('encryption') != 'none' and not passphrase:
raise forms.ValidationError(
_('Passphrase is needed for encryption.'))
return self.cleaned_data
def clean_repository(self):