backups: When restoring, only list apps included in backup

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
James Valleroy authored and Joseph Nuthalapati committed 2018-09-24 19:43:36 +05:30
1 parent 2a9a220770
commit 481a299250
4 files changed
+60 -4

No files matched your search

+1 -2
View File
@@ -67,9 +67,8 @@ class RestoreForm(forms.Form):
def __init__(self, *args, **kwargs):
"""Initialize the form with selectable apps."""
apps = kwargs.pop('apps')
super().__init__(*args, **kwargs)
apps = _list_of_all_apps_for_backup()
# TODO: Only list apps included in the backup file.
self.fields['selected_apps'].choices = [
(app[0], app[1].name) for app in apps]
self.fields['selected_apps'].initial = [app[0] for app in apps]