Commit 9e4118e6 authored by Ayush Tiwari's avatar Ayush Tiwari

sql_catalog: No need to check for type

In case uid=0, its already being treated as int, so there is no
need to check for type and add time to performance.
parent a20c1591
Pipeline #3571 skipped
......@@ -1497,9 +1497,8 @@ class Catalog(Folder,
for object in object_list:
uid = getattr(aq_base(object), 'uid', None)
# Several Tool objects have uid=0 (not 0L) from the beginning, but
# we need an unique uid for each object.
if uid is None or isinstance(uid, int) and uid == 0:
# Generate unique uid for object having 0 or None as uid
if uid is None or uid == 0:
try:
object.uid = self.newUid()
except ConflictError:
......
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