[formrenderers] if a tag object gets there, it blows (closes #2410462)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 27 Jun 2012 18:10:59 +0200
changeset 8445 594efcf51536
parent 8444 7a861620f64f
child 8446 cae198371548
[formrenderers] if a tag object gets there, it blows (closes #2410462) - cwtags monkeypatches cubicweb's UStringIO's .write and .getvalue methods - but it cannot monkeypatch list.append ...
web/views/formrenderers.py
--- a/web/views/formrenderers.py	Thu Jun 14 15:21:12 2012 +0200
+++ b/web/views/formrenderers.py	Wed Jun 27 18:10:59 2012 +0200
@@ -117,7 +117,9 @@
         errormsg = self.error_message(form)
         if errormsg:
             data.insert(0, errormsg)
-        w(''.join(data))
+        # NOTE: we call unicode because `tag` objects may be found within data
+        #       e.g. from the cwtags library
+        w(''.join(unicode(x) for x in data))
 
     def render_content(self, w, form, values):
         if self.display_progress_div: