mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
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
This commit is contained in:
parent
a7a756e27e
commit
56db7a6078
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user