From bf3057d10bc1e78a8e45142a8288a733b3e908a2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sun, 24 Jan 2016 13:41:25 -0500 Subject: [PATCH] Refs #24046 -- Removed redundant condition in render_value_in_context() Calling conditional_escape() on SafeData won't change it. --- django/template/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django/template/base.py b/django/template/base.py index 99f30ff32d..c48746bbef 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -1012,8 +1012,7 @@ def render_value_in_context(value, context): value = template_localtime(value, use_tz=context.use_tz) value = localize(value, use_l10n=context.use_l10n) value = force_text(value) - if ((context.autoescape and not isinstance(value, SafeData)) or - isinstance(value, EscapeData)): + if context.autoescape or isinstance(value, EscapeData): return conditional_escape(value) else: return value