Commit 1bf63acf authored by Jérome Perrin's avatar Jérome Perrin

Make an explicit check that uid is not an integer (long cannot be compared with

is keyword).



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14276 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 00de9e57
......@@ -1462,9 +1462,8 @@ class Catalog( Folder,
if index is not None and index < 0:
raise CatalogError, 'A negative uid %d is used for %s. Your catalog is broken. Recreate your catalog.' % (index, path)
if index:
# Use "is not" instead of "!=", because we want to make sure that
# uid becomes long, if it is int.
if uid is not index:
if uid != index or isinstance(uid, int):
# We want to make sure that uid becomes long if it is an int
LOG('SQLCatalog', WARNING, 'uid of %r changed from %r (property) to %r (catalog, by path) !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, index))
uid = index
object.uid = 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