mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Use isdigit
This commit is contained in:
parent
d79c9b4bf8
commit
1ddca81f5a
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