Skip to content

Commit

Permalink
Refs #29006 -- Simplified handling of SNaN values in DecimalField.val…
Browse files Browse the repository at this point in the history
…idate().
  • Loading branch information
sir-sigurd authored and timgraham committed Jan 11, 2018
1 parent 7c00f9f commit 1dce629
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/forms/fields.py
Expand Up @@ -351,7 +351,7 @@ def validate(self, value):
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):
Expand Down

0 comments on commit 1dce629

Please sign in to comment.