systematically call bool on BooleanField values
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 27 Jan 2010 09:59:55 +0100
changeset 4393 87e48fe398f1
parent 4392 91a56a30141e
child 4394 b98fbca17e9e
systematically call bool on BooleanField values
web/formfields.py
--- a/web/formfields.py	Wed Jan 27 09:59:13 2010 +0100
+++ b/web/formfields.py	Wed Jan 27 09:59:55 2010 +0100
@@ -641,9 +641,7 @@
         return [(form._cw._('yes'), '1'), (form._cw._('no'), '')]
 
     def _ensure_correctly_typed(self, form, value):
-        if value is not None:
-            return bool(value)
-        return value
+        return bool(value)
 
 
 class FloatField(IntField):