#29007 closed Bug (fixed)

DecimalValidator crashes on NaN, SNan, Inf, and Infinity values

Reported by: Fabio Bonelli Owned by: nobody
Component: Core (Other) Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


DecimalValidator crashes if it receives a value like NaN, SNan, Inf, and Infinity.

>>> DecimalValidator(decimal_places=2, max_digits=10)(Decimal('NaN'))
  File "django/tests/validators/tests.py", line 322, in test_func
  File "django/django/core/validators.py", line 417, in __call__
    if exponent >= 0:
TypeError: unorderable types: str() >= int()


Change History (1)

comment:1 Changed 12 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In f636f0bb:

Fixed #29007 -- Fixed DecimalValidator crash on NaN, SNan, Inf, and Infinity values.

Note: See TracTickets for help on using tickets.
Back to Top