mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Improved performance of DecimalField.
strip() is unnecessary because decimal.Decimal() strips the input value.
This commit is contained in:
parent
88e972e46d
commit
e58f79c535
1 changed files with 1 additions and 2 deletions
|
@ -343,9 +343,8 @@ class DecimalField(IntegerField):
|
|||
return None
|
||||
if self.localize:
|
||||
value = formats.sanitize_separators(value)
|
||||
value = str(value).strip()
|
||||
try:
|
||||
value = Decimal(value)
|
||||
value = Decimal(str(value))
|
||||
except DecimalException:
|
||||
raise ValidationError(self.error_messages['invalid'], code='invalid')
|
||||
return value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue