[Erp5-report] r35117 seb - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri May 7 19:28:21 CEST 2010
Author: seb
Date: Fri May 7 19:28:20 2010
New Revision: 35117
URL: http://svn.erp5.org?rev=35117&view=rev
Log:
Installation of business template was failing when the number of
installed business template was big enough.
Parsing a dict in a loop and calling update every time (even if
keys are not changed) seems to be not reliable and this ends up
calling 2 times the same code for the same key.
Modified:
erp5/trunk/products/ERP5/Document/BusinessTemplate.py
Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=35117&r1=35116&r2=35117&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Fri May 7 19:28:20 2010
@@ -1907,9 +1907,8 @@
# each portal type
(default_chain, chain_dict) = getChainByType(context)
# First convert all workflow_ids into list.
- for key in chain_dict:
- chain_dict.update({key: chain_dict[key].\
- split(self._chain_string_separator)})
+ for key, value in chain_dict.iteritems():
+ chain_dict[key] = value.split(self._chain_string_separator)
# Set the default chain to the empty string is probably the
# best solution, by default it is 'default_workflow', which is
# not very usefull
@@ -1966,9 +1965,8 @@
, portal_type))
chain_dict[chain_key] = self._objects[path]
# convert workflow list into string only at the end.
- for key in chain_dict:
- chain_dict.update({key: self._chain_string_separator.\
- join(chain_dict[key])})
+ for key, value in chain_dict.iteritems():
+ chain_dict[key] = self._chain_string_separator.join(value)
context.portal_workflow.manage_changeWorkflows(default_chain,
props=chain_dict)
More information about the Erp5-report
mailing list