Commit 90e1a853 authored by Vincent Pelletier's avatar Vincent Pelletier

Make sure SQL commit is executed even when result-generation query failed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13740 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b981846b
......@@ -202,8 +202,10 @@ class IdTool(UniqueObject, Folder):
raise AttributeError, 'Error while generating Id: ' \
'z_portal_ids_generate_id and/or z_portal_ids_commit could not ' \
'be found.'
result = query(id_group=id_group, id_count=id_count, default=default)
commit()
try:
result = query(id_group=id_group, id_count=id_count, default=default)
finally:
commit()
new_id = result[0]['LAST_INSERT_ID()']
if self.dict_length_ids.get(id_group) is None:
self.dict_length_ids[id_group] = Length(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