backups: Better explanation for the format of upload file

Fixes: #2115.

Tests:

- Visit the backups upload page. Notice that the new help text is as expected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-10-25 07:47:40 -07:00 committed by Veiko Aasa
parent d85105a428
commit 15e9c6cad9
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -15,6 +15,7 @@ from django.core.validators import (FileExtensionValidator,
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from plinth import cfg
from plinth.modules.storage import get_mounts
from plinth.utils import format_lazy
@ -138,7 +139,11 @@ class UploadForm(forms.Form):
label=_('Upload File'), required=True, validators=[
FileExtensionValidator(
['gz'], _('Backup files have to be in .tar.gz format'))
], help_text=_('Select the backup file you want to upload'))
], help_text=format_lazy(
_('Select the backup file to upload from the local computer. This '
'must be a file previously downloaded from the result of a '
'successful backup on a {box_name}. It must have a .tar.gz '
'extension.'), box_name=_(cfg.box_name)))
def repository_validator(path):