Commit 2a8b7fe8 authored by Kevin Deldycke's avatar Kevin Deldycke

Klaus: Raise exception when there is no allowed content type


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4055 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6481a2a2
......@@ -71,6 +71,8 @@ class FolderMixIn(ExtensionClass.Base):
new_id = str(container.generateNewId(id_group = id_group, default=default, method=method))
else:
new_id = str(id)
if not container.allowedContentTypes():
raise 'NoAllowedContenTypesError'
if portal_type is None: portal_type = container.allowedContentTypes()[0].id
self.portal_types.constructContent(type_name=portal_type,
container=container,
......
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