Fixed -- Made DecimalField.to_python() handle non-numeric invalid values.
@@ -1501,7 +1501,7 @@ class DecimalField(Field):
return self.context.create_decimal_from_float(value)
try:
return decimal.Decimal(value)
- except decimal.InvalidOperation:
+ except (decimal.InvalidOperation, TypeError, ValueError):
raise exceptions.ValidationError(
self.error_messages['invalid'],
code='invalid',
