# HG changeset patch # User Aurelien Campeas # Date 1272644669 -7200 # Node ID a7e1b316af037e69c17c4feb249fc94d90766595 # Parent 9bf648d678cdb52055499adb06005d98005e9a27 [hooks/...] fix previous commit diff -r 9bf648d678cd -r a7e1b316af03 hooks/integrity.py --- a/hooks/integrity.py Fri Apr 30 16:39:50 2010 +0200 +++ b/hooks/integrity.py Fri Apr 30 18:24:29 2010 +0200 @@ -164,7 +164,7 @@ """ def precommit_event(self): session = self.session - for values in session.transaction_data['check_constraints_op']: + for values in session.transaction_data.pop('check_constraints_op'): eidfrom, rtype, eidto = values[:3] # first check related entities have not been deleted in the same # transaction @@ -225,7 +225,7 @@ constraints = [c for c in eschema.rdef(attr).constraints if isinstance(c, (RQLUniqueConstraint, RQLConstraint))] if constraints: - hook.set_operation(self._cw, 'check_constraint_op', + hook.set_operation(self._cw, 'check_constraints_op', (self.entity.eid, attr, None) + tuple(constraints), _CheckConstraintsOp) diff -r 9bf648d678cd -r a7e1b316af03 hooks/metadata.py --- a/hooks/metadata.py Fri Apr 30 16:39:50 2010 +0200 +++ b/hooks/metadata.py Fri Apr 30 18:24:29 2010 +0200 @@ -69,7 +69,7 @@ def precommit_event(self): session = self.session - for eid in session.transaction_data['set_creator_op']: + for eid in session.transaction_data.pop('set_creator_op'): if session.deleted_in_transaction(eid): # entity have been created and deleted in the same transaction continue @@ -114,7 +114,7 @@ class _SyncOwnersOp(hook.Operation): def precommit_event(self): - for compositeeid, composedeid in self.session.transaction_data['sync_owners_op']: + for compositeeid, composedeid in self.session.transaction_data.pop('sync_owners_op'): self.session.execute('SET X owned_by U WHERE C owned_by U, C eid %(c)s,' 'NOT EXISTS(X owned_by U, X eid %(x)s)', {'c': compositeeid, 'x': composedeid}) diff -r 9bf648d678cd -r a7e1b316af03 hooks/security.py --- a/hooks/security.py Fri Apr 30 16:39:50 2010 +0200 +++ b/hooks/security.py Fri Apr 30 18:24:29 2010 +0200 @@ -54,11 +54,11 @@ def precommit_event(self): #print 'CheckEntityPermissionOp', self.session.user, self.entity, self.action session = self.session - for values in session.transaction_data['check_entity_perm_op']: + for values in session.transaction_data.pop('check_entity_perm_op'): entity = session.entity_from_eid(values[0]) action = values[1] - entity.check_perm(action) - check_entity_attributes(session, entity, values[2:]) + entity.check_perm(action) + check_entity_attributes(session, entity, values[2:]) def commit_event(self): pass