mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
bugfix
This commit is contained in:
parent
b0dd6a2b2a
commit
cdfae10d40
1 changed files with 6 additions and 2 deletions
|
@ -73,8 +73,12 @@ def http_exec(request):
|
||||||
for key, value in request.args.items():
|
for key, value in request.args.items():
|
||||||
if key in args:
|
if key in args:
|
||||||
# Validate args
|
# Validate args
|
||||||
if 'pattern' in args[key]: validate(args[key]['pattern'], value)
|
if 'pattern' in args[key]:
|
||||||
if 'nargs' not in args[key] or ('nargs' != '*' and 'nargs' != '+'): value = value[0]
|
validate(args[key]['pattern'], value)
|
||||||
|
if 'nargs' not in args[key] or ('nargs' != '*' and 'nargs' != '+'):
|
||||||
|
value = value[0]
|
||||||
|
if 'choices' in args[key] and value not in args[key]['choices']:
|
||||||
|
raise YunoHostError(22, _('Invalid argument') + ' ' + value)
|
||||||
if 'action' in args[key] and args[key]['action'] == 'store_true':
|
if 'action' in args[key] and args[key]['action'] == 'store_true':
|
||||||
yes = ['true', 'True', 'yes', 'Yes']
|
yes = ['true', 'True', 'yes', 'Yes']
|
||||||
value = value in yes
|
value = value in yes
|
||||||
|
|
Loading…
Add table
Reference in a new issue