server/hooks.py
branchstable
changeset 4112 b33a9f3e19d6
parent 4111 1fda1d356741
parent 4098 eb4722dd5f86
child 4116 20b23af4e51e
equal deleted inserted replaced
4111:1fda1d356741 4112:b33a9f3e19d6
   535             if tr is None:
   535             if tr is None:
   536                 msg = session._("transition doesn't belong to entity's workflow")
   536                 msg = session._("transition doesn't belong to entity's workflow")
   537                 raise ValidationError(entity.eid, {'by_transition': msg})
   537                 raise ValidationError(entity.eid, {'by_transition': msg})
   538             if not tr.has_input_state(fromstate):
   538             if not tr.has_input_state(fromstate):
   539                 _ = session._
   539                 _ = session._
   540                 msg = _("transition %s isn't allowed from %s") % (_(tr.name), _(fromstate.name))
   540                 msg = _("transition %(tr)s isn't allowed from %(st)s") % {'tr': _(tr.name),
       
   541                                                                           'st': _(fromstate.name),
       
   542                                                                           }
   541                 raise ValidationError(entity.eid, {'by_transition': msg})
   543                 raise ValidationError(entity.eid, {'by_transition': msg})
   542             if not tr.may_be_fired(foreid):
   544             if not tr.may_be_fired(foreid):
   543                 msg = session._("transition may not be fired")
   545                 msg = session._("transition may not be fired")
   544                 raise ValidationError(entity.eid, {'by_transition': msg})
   546                 raise ValidationError(entity.eid, {'by_transition': msg})
   545         if entity.get('to_state'):
   547         if entity.get('to_state'):