From 3757034d2de03f23dabb9456d773e34b8b09edb0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 4 May 2012 19:27:57 -0400 Subject: - [bug] Fixed issue in unit of work whereby setting a non-None self-referential many-to-one relationship to None would fail to persist the change if the former value was not already loaded. [ticket:2477]. --- lib/sqlalchemy/orm/attributes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm/attributes.py') diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 7625ccead..00d640066 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -627,7 +627,7 @@ class ScalarObjectAttributeImpl(ScalarAttributeImpl): if current is not None: ret = [(instance_state(current), current)] else: - ret = [] + ret = [(None, None)] if self.key in state.committed_state: original = state.committed_state[self.key] -- cgit v1.2.1