Commit 17795b65 authored by Jérome Perrin's avatar Jérome Perrin

don't use hasattr for critical parts such as indexing.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12812 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 45f58cb1
...@@ -548,7 +548,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn): ...@@ -548,7 +548,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
if self.isIndexable: if self.isIndexable:
value_list.append(self) value_list.append(self)
for c in self.objectValues(): for c in self.objectValues():
if hasattr(aq_base(c), 'getIndexableChildValueList'): if getattr(aq_base(c), 'getIndexableChildValueList', None) is not None:
value_list.extend(c.getIndexableChildValueList()) value_list.extend(c.getIndexableChildValueList())
return value_list return value_list
...@@ -566,7 +566,8 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn): ...@@ -566,7 +566,8 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
# Reindex contents # Reindex contents
#LOG('recursiveImmediateReindexObject', 0, 'self = %r, self.objectValues = %r' % (self, self.objectValues())) #LOG('recursiveImmediateReindexObject', 0, 'self = %r, self.objectValues = %r' % (self, self.objectValues()))
for c in self.objectValues(): for c in self.objectValues():
if hasattr(aq_base(c), 'recursiveImmediateReindexObject'): if getattr(aq_base(c),
'recursiveImmediateReindexObject', None) is not None:
c.recursiveImmediateReindexObject(*args, **kw) c.recursiveImmediateReindexObject(*args, **kw)
security.declareProtected( Permissions.ModifyPortalContent, 'recursiveMoveObject' ) security.declareProtected( Permissions.ModifyPortalContent, 'recursiveMoveObject' )
......
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