Merge branch 'add-number-arg-parser' of github.com:YunoHost/yunohost into add-number-arg-parser

This commit is contained in:
Kay0u 2020-11-25 20:17:28 +01:00
commit a84439a0f3
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -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'))