Changed registry access
authorThierry Florac <tflorac@ulthar.net>
Sat, 14 Mar 2015 13:29:14 +0100
changeset 6 4a1bc9eb89ad
parent 5 0fe262326e0e
child 7 570db7b9f0f6
Changed registry access
src/pyams_scheduler/scheduler.py
--- a/src/pyams_scheduler/scheduler.py	Sat Mar 14 13:28:39 2015 +0100
+++ b/src/pyams_scheduler/scheduler.py	Sat Mar 14 13:29:14 2015 +0100
@@ -22,7 +22,7 @@
 
 # import packages
 from pyams_utils.registry import query_utility
-from pyams_utils.request import check_request
+from pyramid.threadlocal import get_current_registry
 from zope.container.folder import Folder
 from zope.interface import implementer
 from zope.schema.fieldproperty import FieldProperty
@@ -69,8 +69,8 @@
 
     def _get_socket(self):
         """Open ØMQ socket"""
-        request = check_request()
-        handler = request.registry.settings.get(SCHEDULER_HANDLER_KEY, False)
+        registry = get_current_registry()
+        handler = registry.settings.get(SCHEDULER_HANDLER_KEY, False)
         if handler:
             context = zmq.Context()
             socket = context.socket(zmq.REQ)