Updated global registry access
authorThierry Florac <tflorac@ulthar.net>
Thu, 08 Feb 2018 08:53:26 +0100
changeset 52 568ef229cc20
parent 51 2be95c766ed0
child 53 df6d15dc695d
Updated global registry access
src/pyams_i18n/negotiator.py
--- a/src/pyams_i18n/negotiator.py	Mon Feb 05 16:30:25 2018 +0100
+++ b/src/pyams_i18n/negotiator.py	Thu Feb 08 08:53:26 2018 +0100
@@ -21,9 +21,8 @@
 
 # import packages
 from pyams_utils.i18n import get_browser_language
-from pyams_utils.registry import query_utility, utility_config
+from pyams_utils.registry import query_utility, utility_config, get_global_registry
 from persistent import Persistent
-from zope.component.globalregistry import getGlobalSiteManager
 from zope.container.contained import Contained
 from zope.i18n.locales import locales
 from zope.interface import implementer
@@ -93,7 +92,7 @@
     else:
         locale_name = get_browser_language(request)
     if not locale_name:
-        registry = getGlobalSiteManager()
+        registry = get_global_registry()
         locale_name = registry.settings.get('pyramid.default_locale_name', 'en')
     if '-' in locale_name:
         # remove 'sub-locale' to prevent Babel and Zope exceptions for unknown locales