Ticket #5355: fields.py.patch

File fields.py.patch, 441 bytes (added by Weipin Xia <webbing@…>, 17 years ago)
  • fields.py

     
    185185        super(DecimalField, self).clean(value)
    186186        if not self.required and value in EMPTY_VALUES:
    187187            return None
     188        if isinstance(value, Decimal):
     189            return value
    188190        value = value.strip()
    189191        try:
    190192            value = Decimal(value)
Back to Top