forms: don't decode value in py3 (#36515)

This commit is contained in:
Frédéric Péters 2019-11-13 14:06:10 +01:00
parent 344498ae4d
commit 2aed9c1bc4
1 changed files with 1 additions and 1 deletions

View File

@ -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: