check a file is submitted first tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 12 May 2009 20:47:42 +0200
branchtls-sprint
changeset 1765 a25c7c73c8f6
parent 1764 73dc7ad124aa
child 1766 6c23a5e0c490
check a file is submitted first
web/views/editcontroller.py
--- a/web/views/editcontroller.py	Tue May 12 20:31:35 2009 +0200
+++ b/web/views/editcontroller.py	Tue May 12 20:47:42 2009 +0200
@@ -207,7 +207,7 @@
                 # file modified using a text widget
                 encoding = entity.attr_metadata(attr, 'encoding')
                 value = Binary(value.encode(encoding))
-            else:
+            elif value:
                 # value is a  3-uple (filename, mimetype, stream)
                 val = Binary(value[2].read())
                 if not val.getvalue(): # usually an unexistant file