server/hooks.py
branchstable
changeset 3508 d9915224f9a5
parent 3071 6ad4e6d4df86
child 3528 77a69de16709
equal deleted inserted replaced
3502:9638213410e9 3508:d9915224f9a5
   566 
   566 
   567 
   567 
   568 def before_add_in_state(session, eidfrom, rtype, eidto):
   568 def before_add_in_state(session, eidfrom, rtype, eidto):
   569     """check state apply, in case of direct in_state change using unsafe_execute
   569     """check state apply, in case of direct in_state change using unsafe_execute
   570     """
   570     """
   571     nocheck = session.transaction_data.setdefault('skip-security', ())
   571     nocheck = session.transaction_data.setdefault('skip-security', set())
   572     if (eidfrom, 'in_state', eidto) in nocheck:
   572     if (eidfrom, 'in_state', eidto) in nocheck:
   573         # state changed through TrInfo insertion, so we already know it's ok
   573         # state changed through TrInfo insertion, so we already know it's ok
   574         return
   574         return
   575     entity = session.entity_from_eid(eidfrom)
   575     entity = session.entity_from_eid(eidfrom)
   576     mainwf = entity.main_workflow
   576     mainwf = entity.main_workflow