Refs #29006 -- Simplified handling of SNaN values in DecimalField.validate().

This commit is contained in:
Sergey Fedoseev 2018-01-11 17:02:46 +05:00 committed by Tim Graham
parent 7c00f9fb1c
commit 1dce629c03
1 changed files with 1 additions and 1 deletions

View File

@ -351,7 +351,7 @@ class DecimalField(IntegerField):
super().validate(value)
if value in self.empty_values:
return
if value.is_nan() or not math.isfinite(value):
if not value.is_finite():
raise ValidationError(self.error_messages['invalid'], code='invalid')
def widget_attrs(self, widget):