# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1242154062 -7200 # Node ID a25c7c73c8f60e0ac50d45b19457c7ff58b66aa8 # Parent 73dc7ad124aae6c8c2408372d8aef147d804833a check a file is submitted first diff -r 73dc7ad124aa -r a25c7c73c8f6 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