[hooks] use local variable stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Jun 2011 17:21:17 +0200
branchstable
changeset 7495 09d245a9bf5f
parent 7494 be957035f2a8
child 7496 0c75ed374b06
child 7498 dc823b9ce74b
[hooks] use local variable
hooks/integrity.py
--- a/hooks/integrity.py	Fri Jun 10 17:21:11 2011 +0200
+++ b/hooks/integrity.py	Fri Jun 10 17:21:17 2011 +0200
@@ -126,9 +126,10 @@
             return
         card = session.schema_rproperty(rtype, eidfrom, eidto, 'cardinality')
         if card[0] in '1+' and not session.deleted_in_transaction(eidfrom):
-            _CheckSRelationOp.get_instance(self._cw).add_data((eidfrom, rtype))
+            _CheckSRelationOp.get_instance(session).add_data((eidfrom, rtype))
         if card[1] in '1+' and not session.deleted_in_transaction(eidto):
-            _CheckORelationOp.get_instance(self._cw).add_data((eidto, rtype))
+            _CheckORelationOp.get_instance(session).add_data((eidto, rtype))
+
 
 class CheckCardinalityHookAfterAddEntity(IntegrityHook):
     """check cardinalities are satisfied"""