mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #29006 -- Fixed DecimalField.clean() crash on sNaN values.
This commit is contained in:
committed by
Tim Graham
parent
1c95737ebe
commit
c886f3dee3
@@ -351,7 +351,7 @@ class DecimalField(IntegerField):
|
||||
super().validate(value)
|
||||
if value in self.empty_values:
|
||||
return
|
||||
if not math.isfinite(value):
|
||||
if value.is_nan() or not math.isfinite(value):
|
||||
raise ValidationError(self.error_messages['invalid'], code='invalid')
|
||||
|
||||
def widget_attrs(self, widget):
|
||||
|
||||
Reference in New Issue
Block a user