equal
deleted
inserted
replaced
428 entity = session.entity_from_eid(fromeid) |
428 entity = session.entity_from_eid(fromeid) |
429 # we should find at least one transition going to this state |
429 # we should find at least one transition going to this state |
430 try: |
430 try: |
431 iter(state.transitions(entity, toeid)).next() |
431 iter(state.transitions(entity, toeid)).next() |
432 except StopIteration: |
432 except StopIteration: |
433 msg = session._('transition is not allowed') |
433 _ = session._ |
|
434 msg = _('transition from %s to %s does not exist or is not allowed') % ( |
|
435 _(state.name), _(session.entity_from_eid(toeid).name)) |
434 raise ValidationError(fromeid, {'in_state': msg}) |
436 raise ValidationError(fromeid, {'in_state': msg}) |
435 else: |
437 else: |
436 # not a transition |
438 # not a transition |
437 # check state is initial state if the workflow defines one |
439 # check state is initial state if the workflow defines one |
438 isrset = session.unsafe_execute('Any S WHERE ET initial_state S, ET name %(etype)s', |
440 isrset = session.unsafe_execute('Any S WHERE ET initial_state S, ET name %(etype)s', |