# HG changeset patch # User Sylvain Thénault # Date 1261506446 -3600 # Node ID 742e3eb16f81f9cd40a30b04eea39a08aa6361a4 # Parent bd552b341334f4ae759db258ef0ebc154b22d4e6 fix bad merge diff -r bd552b341334 -r 742e3eb16f81 hooks/integrity.py --- a/hooks/integrity.py Tue Dec 22 19:26:59 2009 +0100 +++ b/hooks/integrity.py Tue Dec 22 19:27:26 2009 +0100 @@ -164,7 +164,7 @@ events = ('after_add_entity', 'after_update_entity') def __call__(self): - eschema = entity.eschema + eschema = self.entity.e_schema for attr in self.entity.edited_attributes: if eschema.subjrels[attr].final: constraints = [c for c in eschema.rdef(attr).constraints diff -r bd552b341334 -r 742e3eb16f81 hooks/security.py --- a/hooks/security.py Tue Dec 22 19:26:59 2009 +0100 +++ b/hooks/security.py Tue Dec 22 19:27:26 2009 +0100 @@ -100,7 +100,7 @@ rschema = self._cw.repo.schema[self.rtype] rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0], self._cw.describe(self.eidto)[0]) - rdef.check_perm(session, 'add', fromeid=self.eidfrom, toeid=self.eidto) + rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto) class AfterAddRelationSecurityHook(SecurityHook): @@ -135,5 +135,5 @@ rschema = self._cw.repo.schema[self.rtype] rdef = rschema.rdef(self._cw.describe(self.eidfrom)[0], self._cw.describe(self.eidto)[0]) - rdef.check_perm(self._cw, 'add', fromeid=self.eidfrom, toeid=self.eidto) + rdef.check_perm(self._cw, 'delete', fromeid=self.eidfrom, toeid=self.eidto)