[wf] shouldn't check for neweids while trying to get previous state (detected by forge tests) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 17 Aug 2009 12:12:40 +0200
branchstable
changeset 2876 b6993462ddb9
parent 2875 b7399ef8b3e0
child 2877 e469f3602858
[wf] shouldn't check for neweids while trying to get previous state (detected by forge tests)
server/hookhelper.py
--- a/server/hookhelper.py	Mon Aug 17 12:11:54 2009 +0200
+++ b/server/hookhelper.py	Mon Aug 17 12:12:40 2009 +0200
@@ -74,8 +74,9 @@
     relation hooks, the relation may has been deleted at this point, so
     we have handle that
     """
-    if eid in session.transaction_data.get('neweids', ()):
-        return
+    # don't check eid in session.transaction_data.get('neweids', ()), we don't
+    # want to miss previous state of entity whose state change in the same
+    # transaction as it's being created
     pending = session.transaction_data.get('pendingrelations', ())
     for eidfrom, rtype, eidto in reversed(pending):
         if rtype == 'in_state' and eidfrom == eid: