Commit 9bb2c717 authored by Yusei Tahara's avatar Yusei Tahara

if filename is empty string, don't update source_reference. Because it means no file is uploaded.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18414 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b30ba669
......@@ -120,7 +120,9 @@ class File(Document, CMFFile, ConversionCacheMixin):
self._setFile(file, precondition=precondition)
if set_filename__:
filename = getattr(file, 'filename', None)
if filename is not None:
# if file field is empty(no file is uploaded),
# filename is empty string.
if filename is not in (None, ''):
kw['source_reference'] = filename
del kw['file']
Base._edit(self, **kw)
......
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