web/views/editcontroller.py
branchtls-sprint
changeset 1360 13ae1121835e
parent 1263 01152fffd593
child 1361 c558a88bb85d
--- a/web/views/editcontroller.py	Wed Apr 15 14:07:30 2009 +0200
+++ b/web/views/editcontroller.py	Wed Apr 15 14:41:06 2009 +0200
@@ -205,7 +205,8 @@
             # submitted, since it will think the attribute is not modified
             elif isinstance(value, unicode):
                 # file modified using a text widget
-                value = Binary(value.encode(entity.attribute_metadata(attr, 'encoding')))
+                encoding = entity.attr_metadata(attr, 'encoding')
+                value = Binary(value.encode(encoding))
             else:
                 # (filename, mimetype, stream)
                 val = Binary(value[2].read())