mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
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:
parent
5633fccaa3
commit
55355726d5
@ -21,6 +21,7 @@ FreedomBox app to manage backup archives.
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from django.utils.text import get_valid_filename
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from plinth import actions
|
from plinth import actions
|
||||||
@ -105,7 +106,9 @@ def delete_archive(name):
|
|||||||
def export_archive(name, location):
|
def export_archive(name, location):
|
||||||
if location[-1] != '/':
|
if location[-1] != '/':
|
||||||
location += '/'
|
location += '/'
|
||||||
filename = location + 'FreedomBox-backups/' + name + '.tar.gz'
|
|
||||||
|
filename = location + 'FreedomBox-backups/' + get_valid_filename(
|
||||||
|
name) + '.tar.gz'
|
||||||
actions.superuser_run('backups',
|
actions.superuser_run('backups',
|
||||||
['export', '--name', name, '--filename', filename])
|
['export', '--name', name, '--filename', filename])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user