Commit e4c3ab03 authored by Yusei Tahara's avatar Yusei Tahara

Use portal_contribution_registry if available.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20236 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent af1abbdb
...@@ -206,11 +206,18 @@ class Folder: ...@@ -206,11 +206,18 @@ class Folder:
Returns -- Bare and empty object of the appropriate type (or None, if Returns -- Bare and empty object of the appropriate type (or None, if
we don't know what to do) we don't know what to do)
""" """
findPortalTypeName = None
registry = getToolByName(self, 'portal_contribution_registry', None)
if registry is not None:
findPortalTypeName = registry.findPortalTypeName
else:
# Keep backward compatibility
registry = getToolByName(self, 'content_type_registry', None) registry = getToolByName(self, 'content_type_registry', None)
if registry is None: if registry is None:
return None return None
findPortalTypeName = registry.findTypeName
portal_type = registry.findTypeName( name, typ, body ) portal_type = findPortalTypeName(name, typ, body)
if portal_type is None: if portal_type is None:
return None return None
......
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