mirror of https://github.com/django/django.git
Fixed a problem with translatable strings from [5686].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5695 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f2a45f9b38
commit
b8eee39e78
|
@ -113,9 +113,9 @@ class CharField(Field):
|
|||
value = smart_unicode(value)
|
||||
value_length = len(value)
|
||||
if self.max_length is not None and value_length > self.max_length:
|
||||
raise ValidationError(ugettext(u'Ensure this value has at most %d characters (it has %d).') % (self.max_length, value_length))
|
||||
raise ValidationError(ugettext(u'Ensure this value has at most %(max)d characters (it has %(length)d).') % {'max': self.max_length, 'length': value_length})
|
||||
if self.min_length is not None and value_length < self.min_length:
|
||||
raise ValidationError(ugettext(u'Ensure this value has at least %d characters (it has %d).') % (self.min_length, value_length))
|
||||
raise ValidationError(ugettext(u'Ensure this value has at least %(min)d characters (it has %(length)d).') % {'min': self.min_length, 'length': value_length})
|
||||
return value
|
||||
|
||||
def widget_attrs(self, widget):
|
||||
|
|
Loading…
Reference in New Issue