[py3] unicode() -> six.text_type in autoform 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 27 Jun 2019 12:13:21 +0200
branch3.26
changeset 12675 ea89ca9017c4
parent 12674 7ef1c9091283
child 12676 c96aa316d06b
[py3] unicode() -> six.text_type in autoform
cubicweb/web/views/autoform.py
--- a/cubicweb/web/views/autoform.py	Wed Jun 26 15:01:45 2019 +0200
+++ b/cubicweb/web/views/autoform.py	Thu Jun 27 12:13:21 2019 +0200
@@ -118,6 +118,7 @@
 .. Controlling the generic relation fields
 """
 
+import six
 from six.moves import range
 
 from logilab.mtconverter import xml_escape
@@ -310,7 +311,7 @@
         if form.form_previous_values:
             cdvalues = self._cw.list_form_param(eid_param(self.rtype, self.peid),
                                                 form.form_previous_values)
-            if unicode(entity.eid) not in cdvalues:
+            if six.text_type(entity.eid) not in cdvalues:
                 return False
         return True