none check before coercing to bool

This commit is contained in:
Lucas Chi
2014-11-07 16:26:18 -05:00
parent bb7a337981
commit c8d68bb505

View File

@@ -457,7 +457,11 @@ class Boolean(Column):
def validate(self, value):
""" Always returns a Python boolean. """
value = super(Boolean, self).validate(value)
return bool(value)
if value is not None:
value = bool(value)
return value
def to_python(self, value):
return self.validate(value)