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

[hooks] say which are the states (again)

--HG--
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
else:
self.warn('yoo')
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):
try:
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') % (
_(state.name), _(session.entity_from_eid(toeid).name))
raise ValidationError(fromeid, {'in_state': msg})
else:
# 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