Commit f0d644f0 authored by Bartek Górny's avatar Bartek Górny

remove the object from ourselves if an exception was raised while editing it

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14780 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2b353da5
...@@ -278,10 +278,11 @@ class ContributionTool(BaseTool): ...@@ -278,10 +278,11 @@ class ContributionTool(BaseTool):
BaseTool._setObject(self, file_name, ob) BaseTool._setObject(self, file_name, ob)
document = BaseTool._getOb(self, file_name) document = BaseTool._getOb(self, file_name)
try:
# Then edit the document contents (so that upload can happen) # Then edit the document contents (so that upload can happen)
document._edit(**kw) document._edit(**kw)
if url: document.fromURL(url) if url: document.fromURL(url)
finally:
# Remove the object from ourselves # Remove the object from ourselves
BaseTool._delObject(self, file_name) BaseTool._delObject(self, file_name)
......
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