[FIX] web: min/max integer
In PostgreSQL, a field of type `integer` must be in the range -2147483648 to +2147483647. If the user enters a lower or a larger value, a traceback is thrown. opw-740286
This commit is contained in:
@@ -130,7 +130,7 @@ function parse_value (value, descriptor, value_if_empty) {
|
|||||||
} while(tmp !== value);
|
} while(tmp !== value);
|
||||||
tmp = Number(value);
|
tmp = Number(value);
|
||||||
// do not accept not numbers or float values
|
// do not accept not numbers or float values
|
||||||
if (isNaN(tmp) || tmp % 1)
|
if (isNaN(tmp) || tmp % 1 || tmp < -2147483648 || tmp > 2147483647)
|
||||||
throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value));
|
throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value));
|
||||||
return tmp;
|
return tmp;
|
||||||
case 'monetary':
|
case 'monetary':
|
||||||
|
|||||||
Reference in New Issue
Block a user