[composite] apply composite on new enty too stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 31 Jul 2012 11:04:45 +0200
branchstable
changeset 8500 bfc1875ce9e3
parent 8499 75abcdc94f4a
child 8504 f21c72928662
[composite] apply composite on new enty too Before this changesets, automatic deletion did not applied to entity created in the same transaction. This patch remove this filtering in the dedicated operation. The original filtering where introduced by 5d889b4928bb but no rational where found for this changes. The former behavior is seen as inconsistent and creates bug in some cubes.
hooks/integrity.py
--- a/hooks/integrity.py	Tue Jul 31 10:57:03 2012 +0200
+++ b/hooks/integrity.py	Tue Jul 31 11:04:45 2012 +0200
@@ -301,11 +301,10 @@
     def precommit_event(self):
         session = self.session
         pendingeids = session.transaction_data.get('pendingeids', ())
-        neweids = session.transaction_data.get('neweids', ())
         eids_by_etype_rtype = {}
         for eid, rtype in self.get_data():
-            # don't do anything if the entity is being created or deleted
-            if not (eid in pendingeids or eid in neweids):
+            # don't do anything if the entity is being deleted
+            if eid not in pendingeids:
                 etype = session.describe(eid)[0]
                 key = (etype, rtype)
                 if key not in eids_by_etype_rtype: