Commit 26c4e61b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

make newCellContent() try to find '* Cell' portal type if portal type is not specified.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31723 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9b5e6bc4
......@@ -514,6 +514,12 @@ class XMLMatrix(Folder):
Creates a new content as a cell. This method is
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
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