mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #34014 -- Fixed DecimalValidator validating 0 in positive exponent scientific notation.
Thanks Shiplu Mokaddim for the report.
This commit is contained in:
committed by
Mariusz Felisiak
parent
c11336cd99
commit
ae509f8f08
@@ -486,8 +486,10 @@ class DecimalValidator:
|
||||
self.messages["invalid"], code="invalid", params={"value": value}
|
||||
)
|
||||
if exponent >= 0:
|
||||
# A positive exponent adds that many trailing zeros.
|
||||
digits = len(digit_tuple) + exponent
|
||||
digits = len(digit_tuple)
|
||||
if digit_tuple != (0,):
|
||||
# A positive exponent adds that many trailing zeros.
|
||||
digits += exponent
|
||||
decimals = 0
|
||||
else:
|
||||
# If the absolute value of the negative exponent is larger than the
|
||||
|
||||
Reference in New Issue
Block a user