Commit 24ef9034 authored by Romain Courteaud's avatar Romain Courteaud

Compute solver_script_list only once.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12500 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 296d09f7
...@@ -75,6 +75,13 @@ class PropertyDivergenceTester(XMLObject): ...@@ -75,6 +75,13 @@ class PropertyDivergenceTester(XMLObject):
""" """
divergence_message_list = [] divergence_message_list = []
tested_property = self.getTestedPropertyList() tested_property = self.getTestedPropertyList()
# Get the list of solvers callable in this case
solver_script_list = self.getSolverScriptList()
if solver_script_list is None:
solver_script_list = []
solver_script_list = self._splitStringList(solver_script_list)
for tested_property_id, tested_property_title in \ for tested_property_id, tested_property_title in \
self._splitStringList(tested_property): self._splitStringList(tested_property):
...@@ -82,12 +89,7 @@ class PropertyDivergenceTester(XMLObject): ...@@ -82,12 +89,7 @@ class PropertyDivergenceTester(XMLObject):
delivery_mvt_property = delivery_mvt.getProperty(tested_property_id) delivery_mvt_property = delivery_mvt.getProperty(tested_property_id)
simulation_mvt_property = simulation_movement.getProperty(tested_property_id) simulation_mvt_property = simulation_movement.getProperty(tested_property_id)
message = None
if delivery_mvt_property != simulation_mvt_property: if delivery_mvt_property != simulation_mvt_property:
solver_script_list = self.getSolverScriptList()
if solver_script_list is None:
solver_script_list = []
message = ObjectMessage( message = ObjectMessage(
object_relative_url=delivery_mvt.getRelativeUrl(), object_relative_url=delivery_mvt.getRelativeUrl(),
simulation_movement=simulation_movement, simulation_movement=simulation_movement,
...@@ -95,8 +97,8 @@ class PropertyDivergenceTester(XMLObject): ...@@ -95,8 +97,8 @@ class PropertyDivergenceTester(XMLObject):
prevision_value=simulation_mvt_property, prevision_value=simulation_mvt_property,
tested_property=tested_property_id, tested_property=tested_property_id,
message=tested_property_title, message=tested_property_title,
solver_script_list=self._splitStringList(solver_script_list) solver_script_list=solver_script_list
) )
divergence_message_list.append(message) divergence_message_list.append(message)
return divergence_message_list return divergence_message_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment