forms: don't decode value in py3 (#36515)
This commit is contained in:
parent
344498ae4d
commit
2aed9c1bc4
|
@ -527,7 +527,7 @@ class TextWidget(quixote.form.TextWidget):
|
|||
except (TypeError, ValueError):
|
||||
maxlength = 0
|
||||
if maxlength:
|
||||
uvalue = self.value.decode(get_publisher().site_charset)
|
||||
uvalue = self.value if six.PY3 else self.value.decode(get_publisher().site_charset)
|
||||
if len(uvalue) > maxlength:
|
||||
self.error = _('too many characters (limit is %d)') % maxlength
|
||||
if self.validation_function:
|
||||
|
|
Loading…
Reference in New Issue