[Checkins] SVN: CMF/trunk/DCWorkflow/ Fix for #490: use new status
when emiting AfterTransitionEvents
Martijn Pieters
mj at zopatista.com
Fri Aug 10 16:20:05 EDT 2007
Log message for revision 78746:
Fix for #490: use new status when emiting AfterTransitionEvents
Changed:
U CMF/trunk/DCWorkflow/DCWorkflow.py
U CMF/trunk/DCWorkflow/interfaces.py
U CMF/trunk/DCWorkflow/tests/test_DCWorkflow.py
-=-
Modified: CMF/trunk/DCWorkflow/DCWorkflow.py
===================================================================
--- CMF/trunk/DCWorkflow/DCWorkflow.py 2007-08-10 20:19:46 UTC (rev 78745)
+++ CMF/trunk/DCWorkflow/DCWorkflow.py 2007-08-10 20:20:05 UTC (rev 78746)
@@ -534,7 +534,7 @@
script(sci) # May throw an exception.
# Fire "after" event
- notify(AfterTransitionEvent(ob, self, old_sdef, new_sdef, tdef, former_status, kwargs))
+ notify(AfterTransitionEvent(ob, self, old_sdef, new_sdef, tdef, status, kwargs))
# Return the new state object.
if moved_exc is not None:
Modified: CMF/trunk/DCWorkflow/interfaces.py
===================================================================
--- CMF/trunk/DCWorkflow/interfaces.py 2007-08-10 20:19:46 UTC (rev 78745)
+++ CMF/trunk/DCWorkflow/interfaces.py 2007-08-10 20:20:05 UTC (rev 78746)
@@ -33,7 +33,7 @@
new_state = Attribute(u"The state definition of the workflow state before after transition")
transition = Attribute(u"The transition definition taking place. "
"May be None if this is the 'transition' to the initial state.")
- status = Attribute(u"The history/status dict of the object before the transition.")
+ status = Attribute(u"The status dict of the object.")
kwargs = Attribute(u"Any keyword arguments passed to doActionFor() when the transition was invoked")
class IBeforeTransitionEvent(ITransitionEvent):
Modified: CMF/trunk/DCWorkflow/tests/test_DCWorkflow.py
===================================================================
--- CMF/trunk/DCWorkflow/tests/test_DCWorkflow.py 2007-08-10 20:19:46 UTC (rev 78745)
+++ CMF/trunk/DCWorkflow/tests/test_DCWorkflow.py 2007-08-10 20:20:05 UTC (rev 78746)
@@ -129,7 +129,7 @@
self.assertEquals('private', evt.old_state.id)
self.assertEquals('private', evt.new_state.id)
self.assertEquals(None, evt.transition)
- self.assertEquals({}, evt.status)
+ self.assertEquals({'state': 'private', 'comments': ''}, evt.status)
self.assertEquals(None, evt.kwargs)
evt = events[2]
@@ -147,7 +147,7 @@
self.assertEquals('private', evt.old_state.id)
self.assertEquals('published', evt.new_state.id)
self.assertEquals('publish', evt.transition.id)
- self.assertEquals({'state': 'private', 'comments': ''}, evt.status)
+ self.assertEquals({'state': 'published', 'comments': 'foo'}, evt.status)
self.assertEquals({'test' : 'bar', 'comment' : 'foo'}, evt.kwargs)
def test_checkTransitionGuard(self):
More information about the Checkins
mailing list