From c8d68bb5053abb6da846505057ad46599a88c5e6 Mon Sep 17 00:00:00 2001 From: Lucas Chi Date: Fri, 7 Nov 2014 16:26:18 -0500 Subject: [PATCH] none check before coercing to bool --- cqlengine/columns.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cqlengine/columns.py b/cqlengine/columns.py index 056853ab..786dd1ee 100644 --- a/cqlengine/columns.py +++ b/cqlengine/columns.py @@ -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)