Corrected translate call
authorThierry Florac <thierry.florac@onf.fr>
Tue, 10 Jul 2018 16:57:58 +0200
changeset 75 51fae4ef929a
parent 74 9f4143b02965
child 76 1d0d13ab5665
Corrected translate call
src/pyams_thesaurus/thesaurus.py
--- a/src/pyams_thesaurus/thesaurus.py	Tue Jul 10 16:57:41 2018 +0200
+++ b/src/pyams_thesaurus/thesaurus.py	Tue Jul 10 16:57:58 2018 +0200
@@ -46,7 +46,7 @@
 from pyams_security.security import ProtectedObject
 from pyams_security.property import RolePrincipalsFieldProperty
 from pyams_utils.adapter import adapter_config, ContextAdapter, get_annotation_adapter
-from pyams_utils.registry import query_utility, get_utilities_for
+from pyams_utils.registry import query_utility, get_utilities_for, get_global_registry
 from pyams_utils.request import check_request
 from pyams_utils.traversing import get_parent
 from pyams_utils.unicode import translate_string
@@ -391,10 +391,11 @@
     interface = IThesaurusTermExtension
 
     def __init__(self, context=None):
+        registry = get_global_registry()
         translate = check_request().localizer.translate
         try:
             terms = [SimpleTerm(name, title=translate(util.label))
-                     for name, util in get_utilities_for(self.interface)]
+                     for name, util in registry.getUtilitiesFor(self.interface)]
         except ComponentLookupError:
             terms = []
         super(ThesaurusTermExtensionsVocabulary, self).__init__(terms)