# HG changeset patch # User Sylvain Thénault # Date 1268930034 -3600 # Node ID 5774491a1421727de21d24ff26b277292f1150f4 # Parent c3ded02872952ae543bc0f15b38d5f0d1b711c41 cleanup diff -r c3ded0287295 -r 5774491a1421 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