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,16 +72,20 @@ if file.filename not in [\'\', None]:\n ...@@ -72,16 +72,20 @@ if file.filename not in [\'\', None]:\n
}\n }\n
\n \n
container = getToolByName(context.getPortalObject(), \'portal_contributions\', None)\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 \n
is_authorized = 1\n is_authorized = 1\n
if container is None:\n if container is None:\n
container = context\n container = context\n
document_new_content_kw[\'portal_type\'] = portal_type\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 if portal_type not in [\'%s\' % x.id for x in container.allowedContentTypes()]:\n
is_authorized = 0\n is_authorized = 0\n
\n \n
if not context.Base_checkPermission(container.getRelativeUrl(),\n if not context.Base_checkPermission(container.getRelativeUrl(),\n
\'Add portal content\'):\n \'Add portal content\'):\n
is_authorized = 0\n is_authorized = 0\n
\n \n
if not is_authorized:\n if not is_authorized:\n
...@@ -95,8 +99,12 @@ if file.filename not in [\'\', None]:\n ...@@ -95,8 +99,12 @@ if file.filename not in [\'\', None]:\n
\n \n
message = translateString(\'${portal_type} created successfully.\',\n message = translateString(\'${portal_type} created successfully.\',\n
mapping={\'portal_type\': document.getTranslatedPortalType()})\n mapping={\'portal_type\': document.getTranslatedPortalType()})\n
return document.Base_redirect(\'view\', \n if redirect:\n
keep_items=dict(portal_status_message=message))\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> </string> </value>
</item> </item>
<item> <item>
...@@ -152,6 +160,7 @@ if file.filename not in [\'\', None]:\n ...@@ -152,6 +160,7 @@ if file.filename not in [\'\', None]:\n
<string>document_new_content_kw</string> <string>document_new_content_kw</string>
<string>document_edit_kw</string> <string>document_edit_kw</string>
<string>container</string> <string>container</string>
<string>redirect</string>
<string>is_authorized</string> <string>is_authorized</string>
<string>_write_</string> <string>_write_</string>
<string>append</string> <string>append</string>
......
487 488
\ 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