Commit 44d84ef6 authored by Ivan Tyagov's avatar Ivan Tyagov

Do not pass dialog argument to newContent API of portal_contributions. Pass...

Do not pass dialog argument to newContent API of portal_contributions. Pass only what's really needed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14827 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 23eb7607
...@@ -71,24 +71,15 @@ ...@@ -71,24 +71,15 @@
<value> <string>"""\n <value> <string>"""\n
Processes request of ContributionTool_viewContributeFileDialog\n Processes request of ContributionTool_viewContributeFileDialog\n
does what is necessary and calls portal_contributions.newContent\n does what is necessary and calls portal_contributions.newContent\n
redirects to what is returned\n redirects to what is returned.\n
"""\n """\n
\n \n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
portal_type = kw.get(\'portal_type\', None)\n
\n \n
# clean up kw from file field otherwise \n # ingest file (asynchronously)\n
# ZODB raises an exception when committing transaction\n doc = context.portal_contributions.newContent(file = file,\n
kw.pop(\'field_your_file\', None)\n portal_type = portal_type)\n
# remove Base_callDialogMethod arg, otherwise it is set on context\n
# and then we can\'t execute any workflow transition\n
kw.pop(\'Base_callDialogMethod\', None)\n
\n
if kw[\'portal_type\'] == \'\':\n
# we don\'t want to set portal_type to \'\' :)\n
kw.pop(\'portal_type\', None)\n
\n
# ingest file\n
doc = context.portal_contributions.newContent(file=file, **kw)\n
\n \n
msg = translateString("${portal_type} created successfully.",\n msg = translateString("${portal_type} created successfully.",\n
mapping = {\'portal_type\':doc.getPortalType()})\n mapping = {\'portal_type\':doc.getPortalType()})\n
...@@ -149,8 +140,7 @@ return context.Base_redirect(\'view\', keep_items = {\'portal_status_message\':m ...@@ -149,8 +140,7 @@ return context.Base_redirect(\'view\', keep_items = {\'portal_status_message\':m
<string>context</string> <string>context</string>
<string>translateString</string> <string>translateString</string>
<string>None</string> <string>None</string>
<string>_getitem_</string> <string>portal_type</string>
<string>_apply_</string>
<string>doc</string> <string>doc</string>
<string>msg</string> <string>msg</string>
</tuple> </tuple>
......
654 655
\ 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