Commit 55823f5c authored by Romain Courteaud's avatar Romain Courteaud

Do not create non visible portal type.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18825 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b823ef21
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -75,7 +72,7 @@ if not allowed_type_list:\n
return context.ERP5Site_redirect(\'%s/view\' % (context.absolute_url(), ), keep_items={\'portal_status_message\': N_("You are not allowed to add new content in this context.")})\n
\n
# newContent will add the first allowed type when we do not specify portal_type=\n
new_object = context.newContent()\n
new_object = context.newContent(portal_type=allowed_type_list[0])\n
\n
return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), keep_items={\'portal_status_message\': N_("Object Created.")})\n
</string> </value>
......@@ -130,6 +127,7 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke
<string>context</string>
<string>N_</string>
<string>allowed_type_list</string>
<string>_getitem_</string>
<string>new_object</string>
</tuple>
</value>
......
485
\ No newline at end of file
486
\ 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