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

As reindexing no longer tries to solve duplicate uids, don't suggest to reindex.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28857 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8efaafff
...@@ -1313,9 +1313,8 @@ class Catalog(Folder, ...@@ -1313,9 +1313,8 @@ class Catalog(Folder,
elif check_uid: elif check_uid:
uid = object.uid uid = object.uid
if uid in assigned_uid_dict: if uid in assigned_uid_dict:
raise ValueError('uid of %r is %r and \ raise ValueError('uid of %r is %r and '
is already assigned to %s in catalog !!! This can be fatal. You \ 'is already assigned to %s in catalog !!! This can be fatal.' %
should reindex the whole site immediately.' % \
(object, uid, assigned_uid_dict[uid])) (object, uid, assigned_uid_dict[uid]))
path = object.getPath() path = object.getPath()
...@@ -1329,9 +1328,8 @@ class Catalog(Folder, ...@@ -1329,9 +1328,8 @@ class Catalog(Folder,
raise CatalogError, 'A negative uid %d is used for %s. Your catalog is broken. Recreate your catalog.' % (index, path) raise CatalogError, 'A negative uid %d is used for %s. Your catalog is broken. Recreate your catalog.' % (index, path)
if uid != index or isinstance(uid, int): if uid != index or isinstance(uid, int):
# We want to make sure that uid becomes long if it is an int # We want to make sure that uid becomes long if it is an int
raise ValueError('uid of %r changed from %r (property) to %r \ raise ValueError('uid of %r changed from %r (property) to %r '
(catalog, by path) !!! This can be fatal. You should reindex \ '(catalog, by path) !!! This can be fatal' % (object, uid, index))
the whole site immediately.' % (object, uid, index))
else: else:
# Make sure no duplicates - ie. if an object with different path has same uid, we need a new uid # Make sure no duplicates - ie. if an object with different path has same uid, we need a new uid
# This can be very dangerous with relations stored in a category table (CMFCategory) # This can be very dangerous with relations stored in a category table (CMFCategory)
...@@ -1369,10 +1367,11 @@ class Catalog(Folder, ...@@ -1369,10 +1367,11 @@ class Catalog(Folder,
LOG('SQLCatalog', ERROR, 'path of object %r is too long for catalog. You should use a shorter path.' %(object,)) LOG('SQLCatalog', ERROR, 'path of object %r is too long for catalog. You should use a shorter path.' %(object,))
LOG('SQLCatalog', ERROR, LOG('SQLCatalog', ERROR,
'uid of %r changed from %r to %r as old one is assigned to %s in catalog !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, object.uid, catalog_path)) 'uid of %r changed from %r to %r as old one is assigned'
raise ValueError('uid of %r is %r and \ ' to %s in catalog !!! This can be fatal.' % (
is already assigned to %s in catalog !!! This can be fatal. You \ object, uid, object.uid, catalog_path))
should reindex the whole site immediately.' % \ raise ValueError('uid of %r is %r and '
'is already assigned to %s in catalog !!! This can be fatal.' %
(object, uid, catalog_path)) (object, uid, catalog_path))
uid = object.uid uid = object.uid
......
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