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 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -75,7 +72,7 @@ if not allowed_type_list:\n ...@@ -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 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 \n
# newContent will add the first allowed type when we do not specify portal_type=\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 \n
return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), keep_items={\'portal_status_message\': N_("Object Created.")})\n return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), keep_items={\'portal_status_message\': N_("Object Created.")})\n
</string> </value> </string> </value>
...@@ -130,6 +127,7 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke ...@@ -130,6 +127,7 @@ return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), ke
<string>context</string> <string>context</string>
<string>N_</string> <string>N_</string>
<string>allowed_type_list</string> <string>allowed_type_list</string>
<string>_getitem_</string>
<string>new_object</string> <string>new_object</string>
</tuple> </tuple>
</value> </value>
......
485 486
\ No newline at end of file \ 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