mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Convert the value in proper format, as we may only get string values
for integer and numeric type.
This commit is contained in:
parent
242d5f47f6
commit
067c269fc8
@ -146,9 +146,11 @@ class _Preference(object):
|
|||||||
if type(value) != bool:
|
if type(value) != bool:
|
||||||
return False, gettext("Invalid value for boolean type!")
|
return False, gettext("Invalid value for boolean type!")
|
||||||
elif self._type == 'integer':
|
elif self._type == 'integer':
|
||||||
|
value = int(value)
|
||||||
if type(value) != int:
|
if type(value) != int:
|
||||||
return False, gettext("Invalid value for integer type!")
|
return False, gettext("Invalid value for integer type!")
|
||||||
elif self._type == 'numeric':
|
elif self._type == 'numeric':
|
||||||
|
value = float(value)
|
||||||
t = type(value)
|
t = type(value)
|
||||||
if t != float and t != int and t != decimal.Decimal:
|
if t != float and t != int and t != decimal.Decimal:
|
||||||
return False, gettext("Invalid value for numeric type!")
|
return False, gettext("Invalid value for numeric type!")
|
||||||
|
Loading…
Reference in New Issue
Block a user