Commit 9ba74e29 authored by Romain Courteaud's avatar Romain Courteaud

Do not redirect when using portal_contributions, in order to prevent conflict...

Do not redirect when using portal_contributions, in order to prevent conflict with automatic metadata detection

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24824 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 83e771ef
......@@ -72,11 +72,15 @@ if file.filename not in [\'\', None]:\n
}\n
\n
container = getToolByName(context.getPortalObject(), \'portal_contributions\', None)\n
# Do not redirect when using portal_contributions, in order to prevent\n
# conflict with automatic metadata detection\n
redirect = 0\n
\n
is_authorized = 1\n
if container is None:\n
container = context\n
document_new_content_kw[\'portal_type\'] = portal_type\n
redirect = 1\n
if portal_type not in [\'%s\' % x.id for x in container.allowedContentTypes()]:\n
is_authorized = 0\n
\n
......@@ -95,8 +99,12 @@ if file.filename not in [\'\', None]:\n
\n
message = translateString(\'${portal_type} created successfully.\',\n
mapping={\'portal_type\': document.getTranslatedPortalType()})\n
if redirect:\n
return document.Base_redirect(\'view\', \n
keep_items=dict(portal_status_message=message))\n
else:\n
return context.Base_redirect(\'view\', \n
keep_items=dict(portal_status_message=message))\n
</string> </value>
</item>
<item>
......@@ -152,6 +160,7 @@ if file.filename not in [\'\', None]:\n
<string>document_new_content_kw</string>
<string>document_edit_kw</string>
<string>container</string>
<string>redirect</string>
<string>is_authorized</string>
<string>_write_</string>
<string>append</string>
......
487
\ No newline at end of file
488
\ 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