hooks/integrity.py
branchstable
changeset 5450 269dcd14b92c
parent 5449 a7e1b316af03
child 5538 752bc67064f2
--- a/hooks/integrity.py	Fri Apr 30 18:24:29 2010 +0200
+++ b/hooks/integrity.py	Fri Apr 30 19:07:06 2010 +0200
@@ -160,19 +160,18 @@
 
 
 class _CheckConstraintsOp(hook.LateOperation):
-    """check a new relation satisfy its constraints
-    """
+    """ check a new relation satisfy its constraints """
+
     def precommit_event(self):
         session = self.session
         for values in session.transaction_data.pop('check_constraints_op'):
-            eidfrom, rtype, eidto = values[:3]
+            eidfrom, rtype, eidto, constraints = values
             # first check related entities have not been deleted in the same
             # transaction
             if session.deleted_in_transaction(eidfrom):
                 return
             if session.deleted_in_transaction(eidto):
                 return
-            constraints = values[3:]
             for constraint in constraints:
                 # XXX
                 # * lock RQLConstraint as well?
@@ -205,7 +204,7 @@
                                                 'constraints')
         if constraints:
             hook.set_operation(self._cw, 'check_constraints_op',
-                               (self.eidfrom, self.rtype, self.eidto) + tuple(constraints),
+                               (self.eidfrom, self.rtype, self.eidto, tuple(constraints)),
                                _CheckConstraintsOp)
 
 
@@ -226,7 +225,7 @@
                                if isinstance(c, (RQLUniqueConstraint, RQLConstraint))]
                 if constraints:
                     hook.set_operation(self._cw, 'check_constraints_op',
-                                       (self.entity.eid, attr, None) + tuple(constraints),
+                                       (self.entity.eid, attr, None, tuple(constraints)),
                                        _CheckConstraintsOp)