Commit b6d27319 authored by Hanno Schlichting's avatar Hanno Schlichting

I don't like lambda's to return static results

parent 7f27beb1
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
import time import time
from thread import allocate_lock from thread import allocate_lock
from Acquisition import aq_base
from Acquisition import aq_parent
from Products.PluginIndexes.interfaces import IUniqueValueIndex from Products.PluginIndexes.interfaces import IUniqueValueIndex
reportlock = allocate_lock() reportlock = allocate_lock()
...@@ -120,11 +122,12 @@ class CatalogReport(StopWatch): ...@@ -120,11 +122,12 @@ class CatalogReport(StopWatch):
self.request = request self.request = request
self.threshold = threshold self.threshold = threshold
# TODO: how to get an unique id? path = getattr(aq_parent(catalog), 'getPhysicalPath', None)
getPhysicalPath = getattr(catalog.aq_parent, if path is None:
'getPhysicalPath', path = ('', 'NonPersistentCatalog')
lambda: ['', 'DummyCatalog']) else:
self.cid = tuple(getPhysicalPath()) path = tuple(path())
self.cid = path
def stop(self): def stop(self):
super(CatalogReport, self).stop() super(CatalogReport, self).stop()
......
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