--- a/selectors.py Mon Sep 21 18:03:10 2009 +0200
+++ b/selectors.py Mon Sep 21 18:09:38 2009 +0200
@@ -527,12 +527,10 @@
@lltrace
def __call__(self, cls, req, rset=None, row=None, col=0, **kwargs):
try:
- trname = req.execute('Any XN WHERE X is Transition, X eid %(x)s, X name XN',
- {'x': typed_eid(req.form['treid'])})[0][0]
- except (KeyError, IndexError):
- return 0
- # XXX check this is a transition that apply to the object?
- if not trname in self.expected:
+ # XXX check this is a transition that apply to the object?
+ if not kwargs['transition'].name in self.expected:
+ return 0
+ except KeyError:
return 0
return 1
--- a/web/views/workflow.py Mon Sep 21 18:03:10 2009 +0200
+++ b/web/views/workflow.py Mon Sep 21 18:09:38 2009 +0200
@@ -64,7 +64,7 @@
# not entity_implements) is used on custom form
form = self.vreg['forms'].select(
'changestate', self.req, rset=self.rset, row=row, col=col,
- entity=entity, treid=transition.eid,
+ entity=entity, transition=transition,
redirect_path=self.redirectpath(entity))
self.w(form.error_message())
self.w(u'<h4>%s %s</h4>\n' % (_(transition.name),