Commit 63a35fb1 authored by Fabien Morin's avatar Fabien Morin

add a default value to getDefaultModule to use it with getDefaultModuleId


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24293 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 666d020e
...@@ -1063,11 +1063,14 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -1063,11 +1063,14 @@ class ERP5Site(FolderMixIn, CMFSite):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getDefaultModule') 'getDefaultModule')
def getDefaultModule(self, portal_type): def getDefaultModule(self, portal_type, default=MARKER):
""" """
Return default module where a object with portal_type can be created Return default module where a object with portal_type can be created
""" """
return getattr(self, self.getDefaultModuleId(portal_type), None) module_id = self.getDefaultModuleId(portal_type, default)
if module_id:
return getattr(self, module_id, None)
return None
security.declareProtected(Permissions.AddPortalContent, 'newContent') security.declareProtected(Permissions.AddPortalContent, 'newContent')
def newContent(self, id=None, portal_type=None, immediate_reindex=0, **kw): def newContent(self, id=None, portal_type=None, immediate_reindex=0, **kw):
......
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