diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-29 19:30:38 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-11-29 19:30:38 +0000 |
| commit | 29892d02fa9c9ab3e48a18a143408abc3c88716e (patch) | |
| tree | 05773a30e8c6e9005075c9fc21dbae346f8a2b25 /django/newforms | |
| parent | 7a166f1a1c126bea547ad00387ff134ee4743b1c (diff) | |
Fixed #6014 -- More robust error handling when validating decimal fields.
Thanks, pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms')
| -rw-r--r-- | django/newforms/fields.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py index 9b1253de1f..4a54a98d61 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -17,7 +17,7 @@ except NameError: from sets import Set as set from django.utils.translation import ugettext_lazy as _ -from django.utils.encoding import StrAndUnicode, smart_unicode +from django.utils.encoding import StrAndUnicode, smart_unicode, smart_str from util import ErrorList, ValidationError from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput @@ -235,7 +235,7 @@ class DecimalField(Field): super(DecimalField, self).clean(value) if not self.required and value in EMPTY_VALUES: return None - value = str(value).strip() + value = smart_str(value).strip() try: value = Decimal(value) except DecimalException: |
