Commit abf74c46 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

if getPortalType() is missing, that can happen at for example <Folder at xxx...

if getPortalType() is missing, that can happen at for example <Folder at xxx used for /erp5/web_site_module/yyy>, return None instead of raising an exception.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29877 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 24eb7c14
......@@ -53,7 +53,10 @@ class TypesTool(BaseTool, CMFCore_TypesTool.TypesTool):
return BaseTool.getTypeInfo(self)
portal_type, = args
if not isinstance(portal_type, basestring):
portal_type = aq_base(portal_type).getPortalType()
try:
portal_type = aq_base(portal_type).getPortalType()
except AttributeError:
return None
return self._getOb(portal_type, None)
security.declareProtected(Permissions.AddPortalContent,
......
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