summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/sync.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-02-25 18:55:09 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-02-25 18:55:09 -0500
commit95297c35442e483bb98b5a4edb677bb168064f5e (patch)
tree4f266c531075328b763664ccfa73c5066eedd6af /lib/sqlalchemy/orm/sync.py
parent4715aadab3f053c142750879c8fec15c976fff9c (diff)
downloadsqlalchemy-95297c35442e483bb98b5a4edb677bb168064f5e.tar.gz
Detection of a primary key change within the process
of cascading a natural primary key update will succeed even if the key is composite and only some of the attributes have changed. [ticket:2665]
Diffstat (limited to 'lib/sqlalchemy/orm/sync.py')
-rw-r--r--lib/sqlalchemy/orm/sync.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/sync.py b/lib/sqlalchemy/orm/sync.py
index b386a6531..6524ab27a 100644
--- a/lib/sqlalchemy/orm/sync.py
+++ b/lib/sqlalchemy/orm/sync.py
@@ -94,7 +94,8 @@ def source_modified(uowcommit, source, source_mapper, synchronize_pairs):
_raise_col_to_prop(False, source_mapper, l, None, r)
history = uowcommit.get_attribute_history(source, prop.key,
attributes.PASSIVE_NO_INITIALIZE)
- return bool(history.deleted)
+ if bool(history.deleted):
+ return True
else:
return False