# HG changeset patch # User Alexandre Fayolle # Date 1273163019 0 # Node ID 96fd339f7917ed01ecc9f1d7d5664e84f55bdc1d # Parent d1b6db4d7b3fc30250b4933da4cb97ccf18fcc4f Handle new way of reporting unmodified FileFields when a FileField has not been modified, value is an empty string. Handle this is raise UnmodifiedField accordingly. diff -r d1b6db4d7b3f -r 96fd339f7917 web/formfields.py --- a/web/formfields.py Thu May 06 14:48:44 2010 +0200 +++ b/web/formfields.py Thu May 06 16:23:39 2010 +0000 @@ -724,7 +724,10 @@ # will try to remove already attached file if any raise UnmodifiedField() # value is a 2-uple (filename, stream) - filename, stream = value + try: + filename, stream = value + except ValueError: + raise UnmodifiedField() # XXX avoid in memory loading of posted files. Requires Binary handling changes... value = Binary(stream.read()) if not value.getvalue(): # usually an unexistant file