[Erp5-report] r14213 - /erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 25 03:03:52 CEST 2007
Author: yo
Date: Wed Apr 25 03:03:51 2007
New Revision: 14213
URL: http://svn.erp5.org?rev=14213&view=rev
Log:
Make sure that newUid returns a long value when it is not None. Make sure that uid is long in indexing.
Modified:
erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=14213&r1=14212&r2=14213&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Wed Apr 25 03:03:51 2007
@@ -1284,7 +1284,7 @@
self._max_uid = Length()
if uid > self._max_uid():
self._max_uid.set(uid)
- return uid
+ return long(uid)
else:
raise CatalogError("Could not retrieve new uid")
finally:
@@ -1456,13 +1456,15 @@
path = object.getPath()
index = self.getUidForPath(path)
try:
- index = int(index)
+ index = long(index)
except TypeError:
- pass
+ index = None
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:
- if uid != 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:
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
More information about the Erp5-report
mailing list