Updated global registry access
authorThierry Florac <tflorac@ulthar.net>
Thu, 08 Feb 2018 08:52:08 +0100
changeset 372 719c3edee5c1
parent 371 ceeb76aee369
child 373 d541df80c5a7
Updated global registry access
src/pyams_content/shared/form/__init__.py
src/pyams_content/shared/form/field.py
--- a/src/pyams_content/shared/form/__init__.py	Wed Feb 07 14:44:51 2018 +0100
+++ b/src/pyams_content/shared/form/__init__.py	Thu Feb 08 08:52:08 2018 +0100
@@ -25,7 +25,7 @@
 # import packages
 from pyams_content.shared.common import WfSharedContent, SharedContent, register_content_type, WfSharedContentChecker
 from pyams_utils.adapter import adapter_config
-from zope.component.globalregistry import getGlobalSiteManager
+from pyams_utils.registry import get_global_registry
 from zope.interface import implementer, alsoProvides, noLongerProvides
 from zope.schema.fieldproperty import FieldProperty
 
@@ -70,7 +70,7 @@
         if handler is None:
             handler = self._handler
         if handler:
-            registry = getGlobalSiteManager()
+            registry = get_global_registry()
             return registry.queryUtility(IFormHandler, name=handler)
 
 register_content_type(WfForm)
--- a/src/pyams_content/shared/form/field.py	Wed Feb 07 14:44:51 2018 +0100
+++ b/src/pyams_content/shared/form/field.py	Thu Feb 08 08:52:08 2018 +0100
@@ -27,12 +27,11 @@
 # import packages
 from persistent import Persistent
 from pyams_utils.adapter import adapter_config, ContextAdapter
-from pyams_utils.registry import utility_config
+from pyams_utils.registry import utility_config, get_global_registry
 from pyams_utils.request import check_request
 from pyams_utils.schema import MailAddressField
 from pyams_utils.vocabulary import vocabulary_config
 from pyramid.threadlocal import get_current_registry
-from zope.component.globalregistry import getGlobalSiteManager
 from zope.container.contained import Contained
 from zope.container.ordered import OrderedContainer
 from zope.interface import implementer
@@ -65,7 +64,7 @@
     """Form fields container persistent class"""
 
     def get_fields(self):
-        registry = getGlobalSiteManager()
+        registry = get_global_registry()
         fields = []
         for field in self.values():
             if field.visible: