better to use typed eid tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 07 Apr 2009 17:19:13 +0200
branchtls-sprint
changeset 1266 5f16f45e9bae
parent 1265 e5cdd5c0dce3
child 1267 ea03cdbc9f2e
better to use typed eid
common/mixins.py
--- a/common/mixins.py	Tue Apr 07 17:18:54 2009 +0200
+++ b/common/mixins.py	Tue Apr 07 17:19:13 2009 +0200
@@ -10,6 +10,7 @@
 from logilab.common.deprecation import obsolete
 from logilab.common.decorators import cached
 
+from cubicweb import typed_eid
 from cubicweb.selectors import implements
 from cubicweb.interfaces import IWorkflowable, IEmailable, ITree
 
@@ -226,7 +227,8 @@
         parameters, used to be called using __method controler facility
         """
         params = params or self.req.form
-        self.change_state(int(params.pop('state')), params.get('trcomment'),
+        self.change_state(typed_eid(params.pop('state')),
+                          params.get('trcomment'),
                           params.get('trcommentformat'))
         self.req.set_message(self.req._('__msg state changed'))