hooks/syncschema.py
changeset 4951 7dc54e12c606
parent 4930 9fcc9ae2aebe
parent 4948 5774491a1421
child 5174 78438ad513ca
child 5421 8167de96c523
--- a/hooks/syncschema.py	Thu Mar 18 17:31:22 2010 +0100
+++ b/hooks/syncschema.py	Thu Mar 18 17:39:17 2010 +0100
@@ -190,7 +190,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
@@ -673,9 +673,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