[CMF-checkins] SVN: CMF/trunk/CMFCore/ - CMFCore.WorkflowTool:
Using the '(Default)' keyword for a type's
Jens Vagelpohl
jens at dataflake.org
Wed Jun 6 09:37:28 EDT 2007
Log message for revision 76415:
- CMFCore.WorkflowTool: Using the '(Default)' keyword for a type's
workflow chain will now reset any custom workflow chains for the type
(http://www.zope.org/Collectors/CMF/475)
Changed:
U CMF/trunk/CMFCore/WorkflowTool.py
U CMF/trunk/CMFCore/tests/test_WorkflowTool.py
-=-
Modified: CMF/trunk/CMFCore/WorkflowTool.py
===================================================================
--- CMF/trunk/CMFCore/WorkflowTool.py 2007-06-06 13:37:13 UTC (rev 76414)
+++ CMF/trunk/CMFCore/WorkflowTool.py 2007-06-06 13:37:28 UTC (rev 76415)
@@ -387,7 +387,10 @@
return
if isinstance(chain, basestring):
- chain = [ wf.strip() for wf in chain.split(',') if wf.strip() ]
+ if chain == '(Default)':
+ chain = ''
+ else:
+ chain = [ wf.strip() for wf in chain.split(',') if wf.strip() ]
ti_ids = [ t.getId() for t in self._listTypeInfo() ]
Modified: CMF/trunk/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_WorkflowTool.py 2007-06-06 13:37:13 UTC (rev 76414)
+++ CMF/trunk/CMFCore/tests/test_WorkflowTool.py 2007-06-06 13:37:28 UTC (rev 76415)
@@ -301,6 +301,11 @@
tool.setChainForPortalTypes( ('Dummy Content',), None )
self.assertEquals( tool.getChainFor(dummy), ('b', 'a') )
+ # Using the '(Default)' keyword
+ # http://www.zope.org/Collectors/CMF/475
+ tool.setChainForPortalTypes( ('Dummy Content',), '(Default)' )
+ self.assertEquals( tool.getChainFor(dummy), () )
+
def test_getCatalogVariablesFor( self ):
tool = self._makeWithTypesAndChain()
More information about the CMF-checkins
mailing list