mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
sharing: put file path between quotation marks
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
e8b224982f
commit
0b2125aad6
@ -57,7 +57,7 @@ def load_augeas():
|
||||
def subcommand_add(arguments):
|
||||
"""Add a share to Apache configuration."""
|
||||
name = arguments.name
|
||||
path = arguments.path
|
||||
path = '"' + arguments.path + '"'
|
||||
groups = arguments.groups
|
||||
is_public = arguments.is_public
|
||||
url = '/share/' + name
|
||||
@ -154,7 +154,7 @@ def _list(aug=None):
|
||||
name = _get_name_from_url(url)
|
||||
shares.append({
|
||||
'name': name,
|
||||
'path': path,
|
||||
'path': path.strip('"'),
|
||||
'url': '/share/' + name
|
||||
})
|
||||
except ValueError:
|
||||
|
||||
@ -20,8 +20,9 @@ class AddShareForm(forms.Form):
|
||||
'A lowercase alpha-numeric string that uniquely identifies a '
|
||||
'share. Example: <em>media</em>.'))
|
||||
|
||||
path = forms.CharField(
|
||||
label=_('Path to share'), strip=True, help_text=_(
|
||||
path = forms.RegexField(
|
||||
label=_('Path to share'), strip=True, regex=r'^[^\"]+$',
|
||||
help_text=_(
|
||||
'Disk path to a folder on this server that you intend to share.'))
|
||||
|
||||
is_public = forms.BooleanField(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user