Commit addcc4b9 authored by James Valleroy's avatar James Valleroy

backups: List supported and installed apps when creating

Signed-off-by: James Valleroy's avatarJames Valleroy <jvalleroy@mailbox.org>
parent 2bee5452
......@@ -23,6 +23,7 @@ from django.core import validators
from django.utils.translation import ugettext_lazy as _
from . import get_export_locations
from .backups import _list_of_all_apps_for_backup
class CreateArchiveForm(forms.Form):
......@@ -32,10 +33,22 @@ class CreateArchiveForm(forms.Form):
validators.RegexValidator(r'^[^/]+$', _('Invalid archive name'))
])
selected_apps = forms.MultipleChoiceField(
label=_('Included apps'),
help_text=_('Apps to include in the backup'),
widget=forms.CheckboxSelectMultiple)
path = forms.CharField(label=_('Path'), strip=True, help_text=_(
'Disk path to a folder on this server that will be archived into '
'backup repository.'))
def __init__(self, *args, **kwargs):
"""Initialize the form with selectable apps."""
super().__init__(*args, **kwargs)
apps = _list_of_all_apps_for_backup()
self.fields['selected_apps'].choices = [
(app[0], app[1].name) for app in apps]
class ExportArchiveForm(forms.Form):
disk = forms.ChoiceField(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment