1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #6492 -- Added bullet-proofing to isValidFloat validator. Thanks, Bastian Kleineidam.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7258 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-03-17 14:05:43 +00:00
parent 30bdabb2b0
commit 50ecd75379
2 changed files with 9 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ except ImportError:
from django.conf import settings
from django.utils.translation import ugettext as _, ugettext_lazy, ungettext
from django.utils.functional import Promise, lazy
from django.utils.encoding import force_unicode
from django.utils.encoding import force_unicode, smart_str
_datere = r'\d{4}-\d{1,2}-\d{1,2}'
_timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?'
@@ -451,7 +451,7 @@ class IsValidDecimal(object):
"Please enter a valid decimal number with at most %s decimal places.", self.decimal_places) % self.decimal_places
def isValidFloat(field_data, all_data):
data = str(field_data)
data = smart_str(field_data)
try:
float(data)
except ValueError: