mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed #26173 -- Prevented localize_input() from formatting booleans as numbers.
This commit is contained in:
committed by
Tim Graham
parent
bb51dc902d
commit
f7a9872b91
@@ -214,6 +214,8 @@ def localize_input(value, default=None):
|
||||
"""
|
||||
if isinstance(value, six.string_types): # Handle strings first for performance reasons.
|
||||
return value
|
||||
elif isinstance(value, bool): # Don't treat booleans as numbers.
|
||||
return six.text_type(value)
|
||||
elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
|
||||
return number_format(value)
|
||||
elif isinstance(value, datetime.datetime):
|
||||
|
||||
Reference in New Issue
Block a user