Django

Code

Changeset 5192

Show
Ignore:
Timestamp:
05/11/07 09:29:25 (1 year ago)
Author:
mtredinnick
Message:

unicode: Fixed a problem when saving Unicode data in the admin interface.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/django/oldforms/__init__.py

    r5126 r5192  
    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