Convert the value in proper format, as we may only get string values
for integer and numeric type.pull/3/head
parent
242d5f47f6
commit
067c269fc8
|
@ -146,9 +146,11 @@ class _Preference(object):
|
|||
if type(value) != bool:
|
||||
return False, gettext("Invalid value for boolean type!")
|
||||
elif self._type == 'integer':
|
||||
value = int(value)
|
||||
if type(value) != int:
|
||||
return False, gettext("Invalid value for integer type!")
|
||||
elif self._type == 'numeric':
|
||||
value = float(value)
|
||||
t = type(value)
|
||||
if t != float and t != int and t != decimal.Decimal:
|
||||
return False, gettext("Invalid value for numeric type!")
|
||||
|
|
Loading…
Reference in New Issue