Commit 3f1373da authored by Aurelien Campeas's avatar Aurelien Campeas
Browse files

[hooks] say which are the states (again)

branch : stable
parent 1c42a9826dd4
......@@ -77,6 +77,8 @@ class State(AnyEntity):
for tr in rset.entities():
if tr.may_be_passed(entity.eid, self.eid):
yield tr
def after_deletion_path(self):
"""return (path, parameters) which should be used as redirect
......@@ -430,7 +430,9 @@ def before_add_in_state(session, fromeid, rtype, toeid):
iter(state.transitions(entity, toeid)).next()
except StopIteration:
msg = session._('transition is not allowed')
_ = session._
msg = _('transition from %s to %s does not exist or is not allowed') % (
_(, _(session.entity_from_eid(toeid).name))
raise ValidationError(fromeid, {'in_state': msg})
# not a transition
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment