Replace "get_utilities_for" by "get_all_utilities_registered_for" to get all registered utilities for a given interface
authorThierry Florac <thierry.florac@onf.fr>
Fri, 20 Jan 2017 15:41:23 +0100
changeset 68 cf21b8cd6e74
parent 67 aaf228e67189
child 69 8c5bbc396670
Replace "get_utilities_for" by "get_all_utilities_registered_for" to get all registered utilities for a given interface
src/pyams_content/zmi/viewlet/toplinks/__init__.py
--- a/src/pyams_content/zmi/viewlet/toplinks/__init__.py	Fri Jan 20 15:40:59 2017 +0100
+++ b/src/pyams_content/zmi/viewlet/toplinks/__init__.py	Fri Jan 20 15:41:23 2017 +0100
@@ -49,7 +49,7 @@
     def update(self):
         super(SharedSitesMenu, self).update()
         registry = get_local_registry()
-        for name, site in registry.getUtilitiesFor(ISharedSite):
+        for site in registry.getAllUtilitiesRegisteredFor(ISharedSite):
             menu = TopLinksMenu(self.context, self.request, self.__parent__, self)
             menu.label = II18n(site).query_attribute('title', request=self.request) or site.__name__
             menu.url = absolute_url(site, self.request, 'admin#dashboard.html')
@@ -67,7 +67,7 @@
     def update(self):
         super(SharedToolsMenu, self).update()
         registry = get_local_registry()
-        for name, tool in registry.getUtilitiesFor(ISharedTool):
+        for tool in registry.getAllUtilitiesRegisteredFor(ISharedTool):
             if ISharedSite.providedBy(tool):
                 continue
             menu = TopLinksMenu(self.context, self.request, self.__parent__, self)