Ticket #14659: DecimalField-accepting-floats-with-dots.patch

File DecimalField-accepting-floats-with-dots.patch, 478 bytes (added by Miguel Araujo, 14 years ago)

Patch

  • fields/__init__.py

     
    758758        if value is None:
    759759            return value
    760760        try:
    761             return decimal.Decimal(value)
     761            return decimal.Decimal(str(value))
    762762        except decimal.InvalidOperation:
    763763            raise exceptions.ValidationError(self.error_messages['invalid'])
    764764
Back to Top