mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Correct ActionsMapParser and empty value in the api
This commit is contained in:
parent
054dfeab7a
commit
1e84edbd7f
1 changed files with 5 additions and 2 deletions
|
@ -64,6 +64,8 @@ class _HTTPArgumentParser(object):
|
||||||
elif isinstance(value, str):
|
elif isinstance(value, str):
|
||||||
if option_string is not None:
|
if option_string is not None:
|
||||||
arg_strings.append(option_string)
|
arg_strings.append(option_string)
|
||||||
|
# TODO: Review this fix
|
||||||
|
if value:
|
||||||
arg_strings.append(value)
|
arg_strings.append(value)
|
||||||
else:
|
else:
|
||||||
arg_strings.append(value)
|
arg_strings.append(value)
|
||||||
|
@ -79,6 +81,7 @@ class _HTTPArgumentParser(object):
|
||||||
for dest, opt in self._optional.items():
|
for dest, opt in self._optional.items():
|
||||||
if dest in args:
|
if dest in args:
|
||||||
arg_strings = append(arg_strings, args[dest], opt[0])
|
arg_strings = append(arg_strings, args[dest], opt[0])
|
||||||
|
|
||||||
return self._parser.parse_args(arg_strings, namespace)
|
return self._parser.parse_args(arg_strings, namespace)
|
||||||
|
|
||||||
def _error(self, message):
|
def _error(self, message):
|
||||||
|
@ -333,7 +336,7 @@ class ActionsMapParser(BaseActionsMapParser):
|
||||||
|
|
||||||
## Implement virtual properties
|
## Implement virtual properties
|
||||||
|
|
||||||
name = 'api'
|
interface = 'api'
|
||||||
|
|
||||||
|
|
||||||
## Implement virtual methods
|
## Implement virtual methods
|
||||||
|
|
Loading…
Reference in a new issue