Ticket #6014: decimal_v6709.patch

File decimal_v6709.patch, 963 bytes (added by pigletto, 8 years ago)
  • django/newforms/fields.py

     
    1717    from sets import Set as set
    1818
    1919from django.utils.translation import ugettext_lazy as _
    20 from django.utils.encoding import StrAndUnicode, smart_unicode
     20from django.utils.encoding import StrAndUnicode, smart_unicode, smart_str
    2121
    2222from util import ErrorList, ValidationError
    2323from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput
     
    235235        super(DecimalField, self).clean(value)
    236236        if not self.required and value in EMPTY_VALUES:
    237237            return None
    238         value = str(value).strip()
     238        value = smart_str(value).strip()
    239239        try:
    240240            value = Decimal(value)
    241241        except DecimalException:
Back to Top