server/hooks.py
branchstable
changeset 3617 9036a8fbbd57
parent 3568 87a7ca9d8ce6
child 3618 ad04840ab25c
equal deleted inserted replaced
3616:600ee58a1375 3617:9036a8fbbd57
   518             if tr is None:
   518             if tr is None:
   519                 msg = session._("transition doesn't belong to entity's workflow")
   519                 msg = session._("transition doesn't belong to entity's workflow")
   520                 raise ValidationError(entity.eid, {'by_transition': msg})
   520                 raise ValidationError(entity.eid, {'by_transition': msg})
   521             if not tr.has_input_state(fromstate):
   521             if not tr.has_input_state(fromstate):
   522                 msg = session._("transition isn't allowed")
   522                 msg = session._("transition isn't allowed")
       
   523                 print tr.name, fromstate.name, entity.by_transition
   523                 raise ValidationError(entity.eid, {'by_transition': msg})
   524                 raise ValidationError(entity.eid, {'by_transition': msg})
   524             if not tr.may_be_fired(foreid):
   525             if not tr.may_be_fired(foreid):
   525                 msg = session._("transition may not be fired")
   526                 msg = session._("transition may not be fired")
   526                 raise ValidationError(entity.eid, {'by_transition': msg})
   527                 raise ValidationError(entity.eid, {'by_transition': msg})
   527         if entity.get('to_state'):
   528         if entity.get('to_state'):