[CMF-checkins] CVS: CMF/CMFCore - WorkflowTool.py:1.39

Christian Theune ct at gocept.com
Thu Sep 25 06:14:11 EDT 2003


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv22280

Modified Files:
	WorkflowTool.py 
Log Message:
 - False assumptions about parameters in the changeWorkflows method
   fixed. Programmatically changing the default Workflow was
   too complicated


=== CMF/CMFCore/WorkflowTool.py 1.38 => 1.39 ===
--- CMF/CMFCore/WorkflowTool.py:1.38	Fri Mar 14 14:11:39 2003
+++ CMF/CMFCore/WorkflowTool.py	Thu Sep 25 06:14:10 2003
@@ -169,24 +169,25 @@
             self._chains_by_type = cbt = PersistentMapping()
         ti = self._listTypeInfo()
         # Set up the chains by type.
-        for t in ti:
-            id = t.getId()
-            field_name = 'chain_%s' % id
-            chain = props.get(field_name, '(Default)').strip()
-            if chain == '(Default)':
-                # Remove from cbt.
-                if cbt.has_key(id):
-                    del cbt[id]
-            else:
-                chain = chain.replace(',', ' ')
-                ids = []
-                for wf_id in chain.split(' '):
-                    if wf_id:
-                        if not self.getWorkflowById(wf_id):
-                            raise ValueError, (
-                                '"%s" is not a workflow ID.' % wf_id)
-                        ids.append(wf_id)
-                cbt[id] = tuple(ids)
+        if props is not None:
+            for t in ti:
+                id = t.getId()
+                field_name = 'chain_%s' % id
+                chain = props.get(field_name, '(Default)').strip()
+                if chain == '(Default)':
+                    # Remove from cbt.
+                    if cbt.has_key(id):
+                        del cbt[id]
+                else:
+                    chain = chain.replace(',', ' ')
+                    ids = []
+                    for wf_id in chain.split(' '):
+                        if wf_id:
+                            if not self.getWorkflowById(wf_id):
+                                raise ValueError, (
+                                    '"%s" is not a workflow ID.' % wf_id)
+                            ids.append(wf_id)
+                    cbt[id] = tuple(ids)
         # Set up the default chain.
         default_chain = default_chain.replace(',', ' ')
         ids = []




More information about the CMF-checkins mailing list