[hooks] say which are the states (again) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 18 Aug 2009 16:05:50 +0200
branchstable
changeset 2909 e695b7b0359d
parent 2908 1c42a9826dd4
child 2910 66684a293f01
[hooks] say which are the states (again)
entities/wfobjs.py
server/hooks.py
--- a/entities/wfobjs.py	Tue Aug 18 15:50:46 2009 +0200
+++ b/entities/wfobjs.py	Tue Aug 18 16:05:50 2009 +0200
@@ -77,6 +77,8 @@
         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
--- a/server/hooks.py	Tue Aug 18 15:50:46 2009 +0200
+++ b/server/hooks.py	Tue Aug 18 16:05:50 2009 +0200
@@ -430,7 +430,9 @@
             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