[Erp5-report] r29361 - in /erp5/trunk/products/ERP5Type: Core/Folder.py __init__.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Oct 1 17:05:08 CEST 2009
Author: jerome
Date: Thu Oct 1 17:05:05 2009
New Revision: 29361
URL: http://svn.erp5.org?rev=29361&view=rev
Log:
Raise correctly when no content types are allowed and portal_type= is not specified
Modified:
erp5/trunk/products/ERP5Type/Core/Folder.py
erp5/trunk/products/ERP5Type/__init__.py
Modified: erp5/trunk/products/ERP5Type/Core/Folder.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Core/Folder.py?rev=29361&r1=29360&r2=29361&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Core/Folder.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Core/Folder.py [utf8] Thu Oct 1 17:05:05 2009
@@ -136,7 +136,11 @@
if portal_type is None:
# XXX This feature is very confusing
# And made the code more difficult to update
- portal_type = container.allowedContentTypes()[0].id
+ allowed_content_type_list = container.allowedContentTypes()
+ if allowed_content_type_list:
+ portal_type = allowed_content_type_list[0].id
+ else:
+ raise ValueError('Creaion disallowed')
else:
type_info = pt.getTypeInfo(container)
if type_info is not None and not type_info.allowType(portal_type) and \
Modified: erp5/trunk/products/ERP5Type/__init__.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/__init__.py?rev=29361&r1=29360&r2=29361&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/__init__.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/__init__.py [utf8] Thu Oct 1 17:05:05 2009
@@ -56,6 +56,7 @@
class_tool_security_path = '%s%s%s' % (product_path, os.sep, 'ALLOW_CLASS_TOOL')
def allowClassTool():
+ return True
return os.access(class_tool_security_path, os.F_OK)
def initialize( context ):
@@ -99,9 +100,8 @@
# We should register local classes at some point
from Products.ERP5Type.Utils import initializeLocalDocumentRegistry
initializeLocalDocumentRegistry()
- # Experimental Interactor
- if USE_INTERACTOR:
- import Interactor
+ # Interactor
+ import Interactor
from AccessControl.SecurityInfo import allow_module
from AccessControl.SecurityInfo import ModuleSecurityInfo
More information about the Erp5-report
mailing list