mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'add-number-arg-parser' of github.com:YunoHost/yunohost into add-number-arg-parser
This commit is contained in:
commit
a84439a0f3
1 changed files with 3 additions and 3 deletions
|
@ -2609,10 +2609,10 @@ class NumberArgumentParser(YunoHostArgumentFormatParser):
|
|||
if isinstance(question.value, int):
|
||||
return super(NumberArgumentParser, self)._post_parse_value(question)
|
||||
|
||||
try:
|
||||
if isinstance(question.value, str) and question.value.isdigit():
|
||||
return int(question.value)
|
||||
except ValueError:
|
||||
raise YunohostError('app_argument_invalid', name=question.name,
|
||||
|
||||
raise YunohostError('app_argument_invalid', name=question.name,
|
||||
error=m18n.n('invalid_number'))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue