[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:
Nicolas Martinelli
2017-05-02 16:11:01 +02:00
parent e645d38ce1
commit be1ca7b100
@@ -130,7 +130,7 @@ function parse_value (value, descriptor, value_if_empty) {
} while(tmp !== value);
tmp = Number(value);
// 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));
return tmp;
case 'monetary':