From 56db7a6078d4f35f4d2624d717963b43cacf6cc9 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 11 May 2007 14:29:25 +0000 Subject: [PATCH] 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 --- django/oldforms/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/oldforms/__init__.py b/django/oldforms/__init__.py index 439bffa568..6edfd7059d 100644 --- a/django/oldforms/__init__.py +++ b/django/oldforms/__init__.py @@ -400,7 +400,7 @@ class TextField(FormField): self.member_name = member_name def isValidLength(self, data, form): - if data and self.maxlength and len(data.decode(settings.DEFAULT_CHARSET)) > self.maxlength: + if data and self.maxlength and len(smart_unicode(data)) > self.maxlength: raise validators.ValidationError, ungettext("Ensure your text is less than %s character.", "Ensure your text is less than %s characters.", self.maxlength) % self.maxlength