Use global site manager
authorThierry Florac <thierry.florac@onf.fr>
Mon, 11 Sep 2017 14:55:31 +0200
changeset 19 548b72a430c7
parent 18 53998b9969ad
child 20 ea4bfc8f6278
Use global site manager
src/pyams_content_es/utility.py
--- a/src/pyams_content_es/utility.py	Wed Jul 12 14:26:26 2017 +0200
+++ b/src/pyams_content_es/utility.py	Mon Sep 11 14:55:31 2017 +0200
@@ -24,7 +24,7 @@
 from persistent import Persistent
 from pyams_utils.registry import get_utility
 from pyams_zmq.socket import zmq_socket, zmq_response
-from pyramid.threadlocal import get_current_registry
+from zope.component.globalregistry import getGlobalSiteManager
 from zope.container.contained import Contained
 from zope.interface import implementer
 from zope.schema.fieldproperty import FieldProperty
@@ -37,7 +37,7 @@
     zeo_connection = FieldProperty(IContentIndexerUtility['zeo_connection'])
 
     def _get_socket(self):
-        registry = get_current_registry()
+        registry = getGlobalSiteManager()
         handler = registry.settings.get(INDEXER_HANDLER_KEY, False)
         if handler:
             return zmq_socket(handler)