--- a/src/pyams_utils/registry.py Thu Jan 11 16:51:53 2018 +0100
+++ b/src/pyams_utils/registry.py Thu Jan 11 16:56:18 2018 +0100
@@ -38,7 +38,7 @@
# import packages
from pyramid.events import subscriber
-from pyramid.threadlocal import manager, get_current_registry
+from pyramid.threadlocal import manager, get_current_registry as get_request_registry
from ZODB.POSException import POSError
from zope.component.globalregistry import getGlobalSiteManager
from zope.interface import implementedBy, providedBy
@@ -101,14 +101,19 @@
yield registry
-def get_global_registry(context=None):
+def get_current_registry(context=None):
"""Get current or global registry"""
- registry = get_current_registry(context)
+ registry = get_request_registry(context)
if registry is None:
registry = getGlobalSiteManager()
return registry
+def get_global_registry():
+ """Get global registry"""
+ return getGlobalSiteManager()
+
+
def registered_utilities():
"""Get utilities registrations as generator