[Erp5-report] r7545 - /erp5/trunk/products/ERP5/ERP5Site.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed May 31 00:04:26 CEST 2006
Author: jerome
Date: Wed May 31 00:03:57 2006
New Revision: 7545
URL: http://svn.erp5.org?rev=7545&view=rev
Log:
Support default argument in getDefaultModuleId.
Remove historical patch for getPhysicalPath.
Modified:
erp5/trunk/products/ERP5/ERP5Site.py
Modified: erp5/trunk/products/ERP5/ERP5Site.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/ERP5Site.py?rev=7545&r1=7544&r2=7545&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/ERP5Site.py (original)
+++ erp5/trunk/products/ERP5/ERP5Site.py Wed May 31 00:03:57 2006
@@ -37,6 +37,8 @@
from string import join
import os
+MARKER=[]
+
# Site Creation DTML
manage_addERP5SiteForm = Globals.HTMLFile('dtml/addERP5Site', globals())
@@ -694,7 +696,7 @@
security.declareProtected(Permissions.AccessContentsInformation,
'getDefaultModuleId')
- def getDefaultModuleId(self, portal_type):
+ def getDefaultModuleId(self, portal_type, default=MARKER):
"""
Return default module id where a object with portal_type can
be created.
@@ -705,6 +707,8 @@
if not hasattr(portal_object, module_name):
module_name += '_module'
if not hasattr(portal_object, module_name):
+ if default is not MARKER:
+ return default
LOG('ERP5Site, getDefaultModuleId', 0,
'Unable to find default module for portal_type: %s' % \
portal_type)
@@ -1001,7 +1005,7 @@
try:
import Products.NuxUserGroups
withnuxgroups = 1
- except:
+ except ImportError:
withnuxgroups = 0
if ERP5Security is not None:
# Use Pluggable Auth Service instead of the standard acl_users.
@@ -1142,5 +1146,5 @@
template_tool.download(template, id=id)
template_tool[id].install(**kw)
-# Patch the standard method
-CMFSite.getPhysicalPath = ERP5Site.getPhysicalPath
+
+
More information about the Erp5-report
mailing list