Commit 63afd49b authored by Nicolas Delaby's avatar Nicolas Delaby

Avoid usage of getToolByName

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41221 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f315b77c
...@@ -37,7 +37,7 @@ import os ...@@ -37,7 +37,7 @@ import os
from AccessControl import ClassSecurityInfo, getSecurityManager from AccessControl import ClassSecurityInfo, getSecurityManager
from Products.ERP5Type.Globals import InitializeClass, DTMLFile from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.CMFCore.utils import getToolByName, _checkPermission from Products.CMFCore.utils import _checkPermission
from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5 import _dtmldir from Products.ERP5 import _dtmldir
...@@ -203,7 +203,7 @@ class ContributionTool(BaseTool): ...@@ -203,7 +203,7 @@ class ContributionTool(BaseTool):
if portal_type is None: if portal_type is None:
# Guess it with help of portal_contribution_registry # Guess it with help of portal_contribution_registry
registry = getToolByName(portal, 'portal_contribution_registry') registry = portal.portal_contribution_registry
portal_type = registry.findPortalTypeName(filename=filename, portal_type = registry.findPortalTypeName(filename=filename,
content_type=content_type) content_type=content_type)
# #
...@@ -214,7 +214,7 @@ class ContributionTool(BaseTool): ...@@ -214,7 +214,7 @@ class ContributionTool(BaseTool):
version = property_dict.get('version', None) version = property_dict.get('version', None)
language = property_dict.get('language', None) language = property_dict.get('language', None)
if portal_type and reference and version and language: if portal_type and reference and version and language:
portal_catalog = getToolByName(portal, 'portal_catalog') portal_catalog = portal.portal_catalog
document = portal_catalog.getResultValue(portal_type=portal_type, document = portal_catalog.getResultValue(portal_type=portal_type,
reference=reference, reference=reference,
version=version, version=version,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment