Commit 0deb8041 authored by Vincent Pelletier's avatar Vincent Pelletier

Define a method to insert the reserved uid line in the catalog used when clearing catalog.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12686 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89b73b19
...@@ -867,11 +867,7 @@ class Catalog( Folder, ...@@ -867,11 +867,7 @@ class Catalog( Folder,
self.clearReserved() self.clearReserved()
# Add a dummy item so that SQLCatalog will not use existing uids again. # Add a dummy item so that SQLCatalog will not use existing uids again.
if self._max_uid is not None and self._max_uid() != 0: self.insertMaxUid()
method_id = self.sql_catalog_reserve_uid
method = getattr(self, method_id)
self._max_uid.change(1)
method(uid = [self._max_uid()])
# Remove the cache of catalog schema. # Remove the cache of catalog schema.
if hasattr(self, '_v_catalog_schema_dict') : if hasattr(self, '_v_catalog_schema_dict') :
...@@ -879,6 +875,16 @@ class Catalog( Folder, ...@@ -879,6 +875,16 @@ class Catalog( Folder,
self._clearSecurityCache() self._clearSecurityCache()
def insertMaxUid(self):
"""
Add a dummy item so that SQLCatalog will not use existing uids again.
"""
if self._max_uid is not None and self._max_uid() != 0:
method_id = self.sql_catalog_reserve_uid
method = getattr(self, method_id)
self._max_uid.change(1)
method(uid = [self._max_uid()])
def clearReserved(self): def clearReserved(self):
""" """
Clears reserved uids Clears reserved uids
......
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