server/hooks.py
branchstable
changeset 3859 85e6ba89837a
parent 3773 14fde27a70a2
child 3877 7ca53fc72a0a
child 3886 6389e5d6edcb
equal deleted inserted replaced
3858:ba96e4607e67 3859:85e6ba89837a
   529         if swtr is None:
   529         if swtr is None:
   530             if tr is None:
   530             if tr is None:
   531                 msg = session._("transition doesn't belong to entity's workflow")
   531                 msg = session._("transition doesn't belong to entity's workflow")
   532                 raise ValidationError(entity.eid, {'by_transition': msg})
   532                 raise ValidationError(entity.eid, {'by_transition': msg})
   533             if not tr.has_input_state(fromstate):
   533             if not tr.has_input_state(fromstate):
   534                 msg = session._("transition isn't allowed")
   534                 _ = session._
       
   535                 msg = _("transition %s isn't allowed from %s") % (_(tr.name), _(fromstate.name))
   535                 raise ValidationError(entity.eid, {'by_transition': msg})
   536                 raise ValidationError(entity.eid, {'by_transition': msg})
   536             if not tr.may_be_fired(foreid):
   537             if not tr.may_be_fired(foreid):
   537                 msg = session._("transition may not be fired")
   538                 msg = session._("transition may not be fired")
   538                 raise ValidationError(entity.eid, {'by_transition': msg})
   539                 raise ValidationError(entity.eid, {'by_transition': msg})
   539         if entity.get('to_state'):
   540         if entity.get('to_state'):