hooks/integrity.py
branchstable
changeset 7495 09d245a9bf5f
parent 7494 be957035f2a8
child 7502 e7190f7e850e
--- 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"""