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

Jens Vagelpohl jens at dataflake.org
Wed Jun 6 09:36:49 EDT 2007


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

-=-
Modified: CMF/branches/2.0/CMFCore/WorkflowTool.py
===================================================================
--- CMF/branches/2.0/CMFCore/WorkflowTool.py	2007-06-06 13:36:36 UTC (rev 76412)
+++ CMF/branches/2.0/CMFCore/WorkflowTool.py	2007-06-06 13:36:48 UTC (rev 76413)
@@ -411,7 +411,10 @@
             self._chains_by_type = cbt = PersistentMapping()
 
         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.0/CMFCore/tests/test_WorkflowTool.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/test_WorkflowTool.py	2007-06-06 13:36:36 UTC (rev 76412)
+++ CMF/branches/2.0/CMFCore/tests/test_WorkflowTool.py	2007-06-06 13:36:48 UTC (rev 76413)
@@ -268,6 +268,11 @@
         tool.setChainForPortalTypes( ('Dummy Content',), '' )
         self.assertEquals( tool.getChainFor(dummy), () )
 
+        # 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