From 0d568ed59f1aa8b1547c4bc1fcdaec5cc1d5c046 Mon Sep 17 00:00:00 2001 From: Rense VanderHoek Date: Wed, 28 Oct 2015 18:48:58 +0100 Subject: [PATCH] format_html was missing in optional_logout template-tag The new format_html() was still missing in optional_logout template-tag at the NoReverseMatch exception. --- rest_framework/templatetags/rest_framework.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework/templatetags/rest_framework.py index 9eeb19bd90..482e924702 100644 --- a/rest_framework/templatetags/rest_framework.py +++ b/rest_framework/templatetags/rest_framework.py @@ -61,7 +61,8 @@ def optional_logout(request, user): try: logout_url = reverse('rest_framework:logout') except NoReverseMatch: - return ''.format(user=user) + snippet = format_html('', user=escape(user)) + return mark_safe(snippet) snippet = """