equal
deleted
inserted
replaced
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'): |