mirror of
https://github.com/django/django.git
synced 2025-11-27 22:05:04 +00:00
Removed redundant forms.DecimalField.validate() in favor of DecimalValidator.
This commit is contained in:
parent
f4e93919e4
commit
cc3d24d7d5
2 changed files with 1 additions and 8 deletions
|
|
@ -438,7 +438,7 @@ class DecimalValidator:
|
|||
def __call__(self, value):
|
||||
digit_tuple, exponent = value.as_tuple()[1:]
|
||||
if exponent in {'F', 'n', 'N'}:
|
||||
raise ValidationError(self.messages['invalid'])
|
||||
raise ValidationError(self.messages['invalid'], code='invalid')
|
||||
if exponent >= 0:
|
||||
# A positive exponent adds that many trailing zeros.
|
||||
digits = len(digit_tuple) + exponent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue