equal
deleted
inserted
replaced
222 if swtr is None: |
222 if swtr is None: |
223 if tr is None: |
223 if tr is None: |
224 msg = session._("transition doesn't belong to entity's workflow") |
224 msg = session._("transition doesn't belong to entity's workflow") |
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 isn't allowed") |
227 msg = session._("transition %s isn't allowed from %s") % ( |
|
228 _(tr.name), _(fromstate.name)) |
228 raise ValidationError(entity.eid, {'by_transition': msg}) |
229 raise ValidationError(entity.eid, {'by_transition': msg}) |
229 if not tr.may_be_fired(foreid): |
230 if not tr.may_be_fired(foreid): |
230 msg = session._("transition may not be fired") |
231 msg = session._("transition may not be fired") |
231 raise ValidationError(entity.eid, {'by_transition': msg}) |
232 raise ValidationError(entity.eid, {'by_transition': msg}) |
232 if entity.get('to_state'): |
233 if entity.get('to_state'): |
233 deststateeid = entity['to_state'] |
234 deststateeid = entity['to_state'] |
234 if not cowpowers and deststateeid != tr.destination().eid: |
235 if not cowpowers and deststateeid != tr.destination().eid: |