Commit f705e155 authored by Jérome Perrin's avatar Jérome Perrin

don't use getattr, to prevent potential acquisition of id


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25394 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fbd2e035
......@@ -53,11 +53,12 @@ class SplitAndDefer(CopyToTarget):
if movement_quantity > new_movement_quantity:
split_index = 0
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
while getattr(simulation_movement.getParentValue(), new_id, None) is not None:
applied_rule = simulation_movement.getParentValue()
while new_id in applied_rule.objectIds():
split_index += 1
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
# Adopt different dates for deferred movements
new_movement = simulation_movement.getParentValue().newContent(
new_movement = applied_rule.newContent(
portal_type="Simulation Movement",
id=new_id,
efficiency=simulation_movement.getEfficiency(),
......
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