SVN: CMF/branches/2.0/CMFCore/ - CMFCore.WorkflowTool: Using the '(Default)' keyword for a type's
Jens Vagelpohl <[email protected]> Wed, 6 Jun 2007 09:36:49 -0400 (EDT)
| Newsgroups | gmane.comp.web.zope.cmf.cvs |
|---|---|
| Message-ID | <20070606133649.4B07F203309__24343.2039315396$1181137018$gmane$org@mail.zope.org> |
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()