Opened 3 months ago

Closed 8 weeks ago

Last modified 8 weeks ago

#28562 closed Bug (fixed)

DecimalValidator raises ValidationError for decimals in scientific notation

Reported by: Maksim Iakovlev Owned by: Josh Schneier
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Tim Martin Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

>>> validator = DecimalValidator(20, 2)
>>> value = Decimal('7.42403889818E+17')
>>> try:
...     validator(value)
... except Exception as e:
...     print(e)
... 
[u'Ensure that there are no more than 2 decimal places.']
>>> value = Decimal(742403889818000000)
>>> try:
...     validator(value)
... except Exception as e:
...     print(e)
... 
>>> 

Change History (5)

comment:1 Changed 3 months ago by Josh Schneier

Component: UncategorizedCore (Other)
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug
Version: 1.11master

comment:2 Changed 3 months ago by Josh Schneier

Has patch: set
Owner: changed from nobody to Josh Schneier
Status: newassigned

comment:3 Changed 2 months ago by Tim Martin

Cc: Tim Martin added
Triage Stage: AcceptedReady for checkin

comment:4 Changed 8 weeks ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In e8c45963:

Fixed #28562 -- Fixed DecimalValidator handling of positive exponent scientific notation.

comment:5 Changed 8 weeks ago by Tim Graham <timograham@…>

In 7c6590af:

[2.0.x] Fixed #28562 -- Fixed DecimalValidator handling of positive exponent scientific notation.

Backport of e8c45963296eb8bf3938bf9ece30b585a8cbb097 from master

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