Commit 6d9c057c authored by Bartek Górny's avatar Bartek Górny

cleaned and reformatted some code

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12841 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 339d53d4
......@@ -876,25 +876,25 @@ class ERP5Site(FolderMixIn, CMFSite):
if hasattr(portal_object, module_name):
return module_name
# then look for module where the type is allowed
module_name=None
modlist=[m for m in self.objectIds() if m.endswith('module')]
module_name = None
modlist = [m for m in self.objectIds() if m.endswith('module')]
for mod in modlist:
module=self.restrictedTraverse(mod,None)
module = self.restrictedTraverse(mod, None)
if module is None: # we can't access this one
continue
if portal_type in self.portal_types[module.getPortalType()].allowed_content_types:
module_name=mod
module_name = mod
break
if module_name is not None:
return module_name
if default is not MARKER:
return default
# now we fail
LOG('ERP5Site, getDefaultModuleId', 0,
'Unable to find default module for portal_type: %s' % \
portal_type)
raise ValueError, 'Unable to find module for portal_type: %s' % \
portal_type
return module_name
security.declareProtected(Permissions.AccessContentsInformation,
'getDefaultModule')
......
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