forked from ScoDoc/DocScoDoc
Améliore check min/max dans anciens formulaires
This commit is contained in:
parent
0d97d5bfc6
commit
81366e6569
@ -276,14 +276,24 @@ class TF(object):
|
||||
)
|
||||
ok = 0
|
||||
if typ[:3] == "int" or typ == "float" or typ == "real":
|
||||
if "min_value" in descr and val < descr["min_value"]:
|
||||
if (
|
||||
val != ""
|
||||
and val != None
|
||||
and "min_value" in descr
|
||||
and val < descr["min_value"]
|
||||
):
|
||||
msg.append(
|
||||
"La valeur (%d) du champ '%s' est trop petite (min=%s)"
|
||||
% (val, field, descr["min_value"])
|
||||
)
|
||||
ok = 0
|
||||
|
||||
if "max_value" in descr and val > descr["max_value"]:
|
||||
if (
|
||||
val != ""
|
||||
and val != None
|
||||
and "max_value" in descr
|
||||
and val > descr["max_value"]
|
||||
):
|
||||
msg.append(
|
||||
"La valeur (%s) du champ '%s' est trop grande (max=%s)"
|
||||
% (val, field, descr["max_value"])
|
||||
|
Loading…
Reference in New Issue
Block a user