[2.0.x] Refs #14807 -- Removed unneeded mark_safe call

Backport of 68407e3545 from master.
This commit is contained in:
Claude Paroz 2017-10-22 12:10:27 +02:00
parent 57d46606ed
commit f6ea7c139f
1 changed files with 1 additions and 2 deletions

View File

@ -6,7 +6,6 @@ from importlib import import_module
from django.conf import settings from django.conf import settings
from django.utils import dateformat, datetime_safe, numberformat from django.utils import dateformat, datetime_safe, numberformat
from django.utils.functional import lazy from django.utils.functional import lazy
from django.utils.safestring import mark_safe
from django.utils.translation import ( from django.utils.translation import (
check_for_language, get_language, to_locale, check_for_language, get_language, to_locale,
) )
@ -195,7 +194,7 @@ def localize(value, use_l10n=None):
if isinstance(value, str): # Handle strings first for performance reasons. if isinstance(value, str): # Handle strings first for performance reasons.
return value return value
elif isinstance(value, bool): # Make sure booleans don't get treated as numbers elif isinstance(value, bool): # Make sure booleans don't get treated as numbers
return mark_safe(str(value)) return str(value)
elif isinstance(value, (decimal.Decimal, float, int)): elif isinstance(value, (decimal.Decimal, float, int)):
return number_format(value, use_l10n=use_l10n) return number_format(value, use_l10n=use_l10n)
elif isinstance(value, datetime.datetime): elif isinstance(value, datetime.datetime):