From 60744582c4cdcb1339322689e437dc4b8ca02525 Mon Sep 17 00:00:00 2001 From: mrbald Date: Fri, 22 Apr 2016 13:52:47 +0100 Subject: make check for None more restrictive Exception on session.commit() from `ClauseElement.__bool__` when adding an object with field where `server_default` is set to `text('some sql code')` --- lib/sqlalchemy/orm/mapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 06d903e9c..19832779f 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1990,7 +1990,7 @@ class Mapper(InspectionAttr): frozenset( col.key for col in columns if not col.primary_key and - not col.server_default and not col.default + col.server_default is None and col.default is None and not col.type.should_evaluate_none) ) for table, columns in self._cols_by_table.items() -- cgit v1.2.1