Commit 7965f340 authored by Alexandre Boeglin's avatar Alexandre Boeglin

If simple method of getDefaultModuleId works, no need to try the more complex

one.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15228 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8e4d4241
...@@ -938,16 +938,18 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -938,16 +938,18 @@ class ERP5Site(FolderMixIn, CMFSite):
if portal_object._getOb(expected_module_id, None) is not None: if portal_object._getOb(expected_module_id, None) is not None:
module_id = expected_module_id module_id = expected_module_id
expected_module_id += '_module' expected_module_id += '_module'
if portal_object._getOb(expected_module_id, None) is not None: if module is None and portal_object._getOb(expected_module_id, None) \
is not None:
module_id = expected_module_id module_id = expected_module_id
# then look for module where the type is allowed # then look for module where the type is allowed
for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)): if module_id is None:
module = portal_object._getOb(expected_module_id, None) for expected_module_id in portal_object.objectIds(spec=('ERP5 Folder',)):
if module is not None: module = portal_object._getOb(expected_module_id, None)
if portal_type in self.portal_types[module.getPortalType()].\ if module is not None:
allowed_content_types: if portal_type in self.portal_types[module.getPortalType()].\
module_id = expected_module_id allowed_content_types:
break module_id = expected_module_id
break
if module_id is None: if module_id is None:
if default is not MARKER: if default is not MARKER:
......
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