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): ...@@ -516,11 +516,12 @@ class XMLMatrix(Folder):
meant to be overriden by subclasses. meant to be overriden by subclasses.
""" """
if portal_type is None: if portal_type is None:
try: for x in self.allowedContentTypes():
portal_type = [x.getId() for x in self.allowedContentTypes() \ id = x.getId()
if x.getId().endswith(' Cell')][0] if id.endswith(' Cell'):
except IndexError: portal_type = id
pass break
return self.newContent(id=id, portal_type=portal_type, **kw) return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected( Permissions.AccessContentsInformation, 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