Ticket #6492: 0023-isValidFloat-should-handle-Unicode-data.patch
| File 0023-isValidFloat-should-handle-Unicode-data.patch, 1.3 kB (added by Bastian Kleineidam <calvin@debian.org>, 10 months ago) |
|---|
-
a/django/core/validators.py
old new 18 18 from django.conf import settings 19 19 from django.utils.translation import ugettext as _, ugettext_lazy, ungettext 20 20 from django.utils.functional import Promise, lazy 21 from django.utils.encoding import force_unicode 21 from django.utils.encoding import force_unicode, smart_str 22 22 23 23 _datere = r'\d{4}-\d{1,2}-\d{1,2}' 24 24 _timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?' … … 451 451 "Please enter a valid decimal number with at most %s decimal places.", self.decimal_places) % self.decimal_places 452 452 453 453 def isValidFloat(field_data, all_data): 454 data = s tr(field_data)454 data = smart_str(field_data) 455 455 try: 456 456 float(data) 457 457 except ValueError:
