backups: Use valid filename for export

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
James Valleroy 2018-09-01 20:24:00 -04:00 committed by Joseph Nuthalapati
parent 5633fccaa3
commit 55355726d5
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35

View File

@ -21,6 +21,7 @@ FreedomBox app to manage backup archives.
import json
import os
from django.utils.text import get_valid_filename
from django.utils.translation import ugettext_lazy as _
from plinth import actions
@ -105,7 +106,9 @@ def delete_archive(name):
def export_archive(name, location):
if location[-1] != '/':
location += '/'
filename = location + 'FreedomBox-backups/' + name + '.tar.gz'
filename = location + 'FreedomBox-backups/' + get_valid_filename(
name) + '.tar.gz'
actions.superuser_run('backups',
['export', '--name', name, '--filename', filename])