Make digits with None behaves like None digits

issue5019
review23501002
This commit is contained in:
Cédric Krier committed 2015-10-08 19:41:04 +02:00
1 parent 7d803387f3
commit e1412d79b4
1 file changed
+1 -1
+1 -1
View File
@@ -300,7 +300,7 @@ class FloatField(Field):
def digits(self, record, factor=1):
digits = record.expr_eval(self.attrs.get('digits'))
if not digits:
if not digits or any(d is None for d in digits):
return
shift = int(round(math.log(abs(factor), 10)))
return (digits[0] + shift, digits[1] - shift)