Skip to content

Commit 56db7a6

Browse files
committed
unicode: Fixed a problem when saving Unicode data in the admin interface.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent a7a756e commit 56db7a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django/oldforms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def __init__(self, field_name, length=30, maxlength=None, is_required=False, val
400400
self.member_name = member_name
401401

402402
def isValidLength(self, data, form):
403-
if data and self.maxlength and len(data.decode(settings.DEFAULT_CHARSET)) > self.maxlength:
403+
if data and self.maxlength and len(smart_unicode(data)) > self.maxlength:
404404
raise validators.ValidationError, ungettext("Ensure your text is less than %s character.",
405405
"Ensure your text is less than %s characters.", self.maxlength) % self.maxlength
406406

0 commit comments

Comments
 (0)