Permalink
Browse files

Refs #29006 -- Simplified handling of SNaN values in DecimalField.val…

…idate().
  • Loading branch information...
1 parent 7c00f9f commit 1dce629c038b88a26d02ddc9d5e7f047933581ee @sir-sigurd sir-sigurd committed with timgraham Jan 11, 2018
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/forms/fields.py
View
@@ -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):

0 comments on commit 1dce629

Please sign in to comment.