From 067c269fc853a2f516c358e8f35635d8a56b8bfa Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Thu, 24 Mar 2016 14:29:44 +0530 Subject: [PATCH] Convert the value in proper format, as we may only get string values for integer and numeric type. --- web/pgadmin/utils/preferences.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/pgadmin/utils/preferences.py b/web/pgadmin/utils/preferences.py index 2fe001d4d..dbdf263ae 100644 --- a/web/pgadmin/utils/preferences.py +++ b/web/pgadmin/utils/preferences.py @@ -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!")