Commit 2e5ffd51 authored by Nicolas Dumazet's avatar Nicolas Dumazet

do not compute the whole portal type list to only take the first item


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32728 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 188ea99c
......@@ -516,11 +516,12 @@ class XMLMatrix(Folder):
meant to be overriden by subclasses.
"""
if portal_type is None:
try:
portal_type = [x.getId() for x in self.allowedContentTypes() \
if x.getId().endswith(' Cell')][0]
except IndexError:
pass
for x in self.allowedContentTypes():
id = x.getId()
if id.endswith(' Cell'):
portal_type = id
break
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected( Permissions.AccessContentsInformation,
......
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