Commit ff2af166 authored by Romain Courteaud's avatar Romain Courteaud

Check allowedContentTypes on the parent level, instead of raising a error.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10169 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2d9d938b
......@@ -76,13 +76,18 @@ parent = context.aq_parent\n
\n
# XXX May be this need to be changed in order to get something else than\n
# the permission "Add portal content"\n
new_id = parent.generateNewId()\n
context.portal_types.constructContent(type_name=context.portal_type,\n
if not parent.allowedContentTypes():\n
return context.ERP5XhtmlStyle_redirect(\'%s/%s/view\' % (parent.getUrl(), context.getId()), \n
keep_items={\'portal_status_message\': N_("You are not allowed to add new content in this context.")})\n
\n
else:\n
new_id = parent.generateNewId()\n
context.portal_types.constructContent(type_name=context.portal_type,\n
container=parent,\n
id=str(new_id),\n
RESPONSE=REQUEST.RESPONSE)\n
\n
return context.ERP5XhtmlStyle_redirect(\'%s/%s/view\' % (parent.getUrl(), new_id), keep_items={\'portal_status_message\': N_("Object Created.")})\n
return context.ERP5XhtmlStyle_redirect(\'%s/%s/view\' % (parent.getUrl(), new_id), \n
keep_items={\'portal_status_message\': N_("Object Created.")})\n
</string> </value>
</item>
<item>
......
208
\ No newline at end of file
209
\ No newline at end of file
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