[CMF-checkins] SVN: CMF/branches/2.1/CMFCore/ - CMFCore.WorkflowTool: Using the '(Default)' keyword for a type's

Jens Vagelpohl jens at dataflake.org
Wed Jun 6 09:37:14 EDT 2007


Log message for revision 76414:
  - 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/branches/2.1/CMFCore/WorkflowTool.py
  U   CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py

-=-
Modified: CMF/branches/2.1/CMFCore/WorkflowTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/WorkflowTool.py	2007-06-06 13:36:48 UTC (rev 76413)
+++ CMF/branches/2.1/CMFCore/WorkflowTool.py	2007-06-06 13:37:13 UTC (rev 76414)
@@ -394,7 +394,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/branches/2.1/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py	2007-06-06 13:36:48 UTC (rev 76413)
+++ CMF/branches/2.1/CMFCore/tests/test_WorkflowTool.py	2007-06-06 13:37:13 UTC (rev 76414)
@@ -308,6 +308,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