cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 18 Mar 2010 17:33:54 +0100
branchstable
changeset 4948 5774491a1421
parent 4947 c3ded0287295
child 4949 f4dce73da26b
cleanup
hooks/syncschema.py
--- a/hooks/syncschema.py	Thu Mar 18 17:33:35 2010 +0100
+++ b/hooks/syncschema.py	Thu Mar 18 17:33:54 2010 +0100
@@ -189,7 +189,7 @@
 
     def prepare_constraints(self, rdef):
         # if constraints is already a list, reuse it (we're updating multiple
-        # constraints of the same rdef in the same transactions
+        # constraints of the same rdef in the same transactions)
         if not isinstance(rdef.constraints, list):
             rdef.constraints = list(rdef.constraints)
         self.constraints = rdef.constraints
@@ -667,9 +667,8 @@
             return
         rdef = self.session.vreg.schema.schema_by_eid(rdef.eid)
         self.prepare_constraints(rdef)
-        subjtype, rtype, objtype = rdef.as_triple()
         cstrtype = self.entity.type
-        self.cstr = rtype.rdef(subjtype, objtype).constraint_by_type(cstrtype)
+        self.cstr = rdef.constraint_by_type(cstrtype)
         self.newcstr = CONSTRAINTS[cstrtype].deserialize(self.entity.value)
         self.newcstr.eid = self.entity.eid