Commit 005c304c authored by Jérome Perrin's avatar Jérome Perrin

Code simplification from in r29083 had a side effect of having 1 instead of 0

as default value, restore previous behaviour.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29128 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 21aaeca8
......@@ -92,11 +92,17 @@ class IdTool(BaseTool):
# Getting the last id
if default is None:
default = 0
new_id = dict_ids.get(id_group, default)
marker = []
new_id = dict_ids.get(id_group, marker)
if method is None:
new_id = new_id + 1
if new_id is marker:
new_id = default
else:
new_id = new_id + 1
else:
new_id = method(new_id)
if new_id is marker:
new_id = default
new_id = method(new_id)
# Store the new value
dict_ids[id_group] = new_id
return new_id
......
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