web/views/forms.py
changeset 10786 2ef74a6e6785
parent 10714 8a2ec43fcf44
child 11033 63d860a14a17
--- a/web/views/forms.py	Mon Oct 12 20:43:50 2015 +0200
+++ b/web/views/forms.py	Mon Oct 12 21:48:50 2015 +0200
@@ -50,6 +50,8 @@
 import time
 import inspect
 
+from six import text_type
+
 from logilab.common import dictattr, tempattr
 from logilab.common.decorators import iclassmethod, cached
 from logilab.common.textutils import splitstrip
@@ -287,7 +289,7 @@
                 except ProcessFormError as exc:
                     errors.append((field, exc))
             if errors:
-                errors = dict((f.role_name(), unicode(ex)) for f, ex in errors)
+                errors = dict((f.role_name(), text_type(ex)) for f, ex in errors)
                 raise ValidationError(None, errors)
             return processed