diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py index 23b500393f..25442194f2 100644 --- a/app/scodoc/TrivialFormulator.py +++ b/app/scodoc/TrivialFormulator.py @@ -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"])