mirror of https://github.com/django/django.git
Refs #29006 -- Simplified handling of SNaN values in DecimalField.validate().
This commit is contained in:
parent
7c00f9fb1c
commit
1dce629c03
|
@ -351,7 +351,7 @@ class DecimalField(IntegerField):
|
||||||
super().validate(value)
|
super().validate(value)
|
||||||
if value in self.empty_values:
|
if value in self.empty_values:
|
||||||
return
|
return
|
||||||
if value.is_nan() or not math.isfinite(value):
|
if not value.is_finite():
|
||||||
raise ValidationError(self.error_messages['invalid'], code='invalid')
|
raise ValidationError(self.error_messages['invalid'], code='invalid')
|
||||||
|
|
||||||
def widget_attrs(self, widget):
|
def widget_attrs(self, widget):
|
||||||
|
|
Loading…
Reference in New Issue