From 68407e3545f4b3e051c87cd530c97765bf2cdd80 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sun, 22 Oct 2017 12:10:27 +0200 Subject: [PATCH] Refs #14807 -- Removed unneeded mark_safe call --- django/utils/formats.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django/utils/formats.py b/django/utils/formats.py index f19449ec1e..bba45e3677 100644 --- a/django/utils/formats.py +++ b/django/utils/formats.py @@ -6,7 +6,6 @@ from importlib import import_module from django.conf import settings from django.utils import dateformat, datetime_safe, numberformat from django.utils.functional import lazy -from django.utils.safestring import mark_safe from django.utils.translation import ( 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. return value 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)): return number_format(value, use_l10n=use_l10n) elif isinstance(value, datetime.datetime):