Ticket #6014: decimal_v6709.patch
File decimal_v6709.patch, 963 bytes (added by , 17 years ago) |
---|
-
django/newforms/fields.py
17 17 from sets import Set as set 18 18 19 19 from django.utils.translation import ugettext_lazy as _ 20 from django.utils.encoding import StrAndUnicode, smart_unicode 20 from django.utils.encoding import StrAndUnicode, smart_unicode, smart_str 21 21 22 22 from util import ErrorList, ValidationError 23 23 from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput … … 235 235 super(DecimalField, self).clean(value) 236 236 if not self.required and value in EMPTY_VALUES: 237 237 return None 238 value = s tr(value).strip()238 value = smart_str(value).strip() 239 239 try: 240 240 value = Decimal(value) 241 241 except DecimalException: