Ticket #5809: 5809-UnicodeEncodeError.patch
File 5809-UnicodeEncodeError.patch, 576 bytes (added by , 17 years ago) |
---|
-
core/validators.py
435 435 val = Decimal(field_data) 436 436 except DecimalException: 437 437 raise ValidationError, _("Please enter a valid decimal number.") 438 except UnicodeEncodeError: 439 raise ValidationError, _("Please enter a valid decimal number.") 438 440 439 441 pieces = str(val).lstrip("-").split('.') 440 442 decimals = (len(pieces) == 2) and len(pieces[1]) or 0