don't allow that even with cow powers stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 21 Oct 2009 15:12:29 +0200
branchstable
changeset 3773 14fde27a70a2
parent 3772 316d0b524db8
child 3774 1eca47d59fd9
don't allow that even with cow powers
server/hooks.py
--- a/server/hooks.py	Wed Oct 21 14:39:26 2009 +0200
+++ b/server/hooks.py	Wed Oct 21 15:12:29 2009 +0200
@@ -13,7 +13,7 @@
 from cubicweb import UnknownProperty, ValidationError, BadConnectionId
 from cubicweb.schema import RQLVocabularyConstraint
 from cubicweb.server.pool import Operation, LateOperation, PreCommitOperation
-from cubicweb.server.hookhelper import (check_internal_entity, 
+from cubicweb.server.hookhelper import (check_internal_entity,
                                         get_user_sessions, rproperty)
 from cubicweb.server.repository import FTIndexEntityOp
 
@@ -519,8 +519,8 @@
             msg = session._('mandatory relation')
             raise ValidationError(entity.eid, {'by_transition': msg})
         deststate = wf.state_by_eid(deststateeid)
-        if not cowpowers and deststate is None:
-            msg = entity.req._("state doesn't belong to entity's workflow")
+        if deststate is None:
+            msg = entity.req._("state doesn't belong to entity's current workflow")
             raise ValidationError(entity.eid, {'to_state': msg})
     else:
         # check transition is valid and allowed, unless we're coming back from