hooks/workflow.py
changeset 4088 23ce2b3fb03d
parent 4075 e710f4052bd6
child 4181 c79135c217df
equal deleted inserted replaced
4087:2b8bc4cfd6ee 4088:23ce2b3fb03d
   274     __select__ = WorkflowHook.__select__ & hook.match_rtype('in_state')
   274     __select__ = WorkflowHook.__select__ & hook.match_rtype('in_state')
   275     events = ('before_add_relation',)
   275     events = ('before_add_relation',)
   276 
   276 
   277     def __call__(self):
   277     def __call__(self):
   278         session = self._cw
   278         session = self._cw
   279         nocheck = session.transaction_data.setdefault('skip-security', ())
   279         nocheck = session.transaction_data.get('skip-security', ())
   280         if (self.eidfrom, 'in_state', self.eidto) in nocheck:
   280         if (self.eidfrom, 'in_state', self.eidto) in nocheck:
   281             # state changed through TrInfo insertion, so we already know it's ok
   281             # state changed through TrInfo insertion, so we already know it's ok
   282             return
   282             return
   283         entity = session.entity_from_eid(self.eidfrom)
   283         entity = session.entity_from_eid(self.eidfrom)
   284         mainwf = entity.main_workflow
   284         mainwf = entity.main_workflow