Commit 6cd2763d authored by Yusei Tahara's avatar Yusei Tahara

Use set_filename__ only if _edit method supports.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19468 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 35763182
......@@ -32,6 +32,7 @@ import string
import socket
import md5
import urllib2, urllib
import inspect
from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass, DTMLFile
......@@ -356,7 +357,11 @@ class ContributionTool(BaseTool):
try:
# Then edit the document contents (so that upload can happen)
document._edit(set_filename__=0, **kw)
if 'set_filename__' in inspect.getargspec(document._edit)[0]:
# Only a few classes supports set_filename__.
document._edit(set_filename__=0, **kw)
else:
document._edit(**kw)
if url:
document.fromURL(url)
finally:
......
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