hooks/workflow.py
changeset 4003 b9436fe77c9e
parent 3894 27cbf98ad863
child 4024 6a14cff373c3
equal deleted inserted replaced
3998:94cc7cad3d2d 4003:b9436fe77c9e
   225                     raise ValidationError(entity.eid, {'by_transition': msg})
   225                     raise ValidationError(entity.eid, {'by_transition': msg})
   226                 if not tr.has_input_state(fromstate):
   226                 if not tr.has_input_state(fromstate):
   227                     msg = session._("transition %s isn't allowed from %s") % (
   227                     msg = session._("transition %s isn't allowed from %s") % (
   228                         _(tr.name), _(fromstate.name))
   228                         _(tr.name), _(fromstate.name))
   229                     raise ValidationError(entity.eid, {'by_transition': msg})
   229                     raise ValidationError(entity.eid, {'by_transition': msg})
   230                  if not tr.may_be_fired(foreid):
   230                 if not tr.may_be_fired(foreid):
   231                     msg = session._("transition may not be fired")
   231                     msg = session._("transition may not be fired")
   232                     raise ValidationError(entity.eid, {'by_transition': msg})
   232                     raise ValidationError(entity.eid, {'by_transition': msg})
   233             if entity.get('to_state'):
   233             if entity.get('to_state'):
   234                 deststateeid = entity['to_state']
   234                 deststateeid = entity['to_state']
   235                 if not cowpowers and deststateeid != tr.destination().eid:
   235                 if not cowpowers and deststateeid != tr.destination().eid: