Skip to content

Commit a67d231

Browse files
committed
Merge pull request #3556 from rense/master
format_html was missing in optional_logout template-tag
2 parents b8c9c80 + 0d568ed commit a67d231

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework/templatetags/rest_framework.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def optional_logout(request, user):
6161
try:
6262
logout_url = reverse('rest_framework:logout')
6363
except NoReverseMatch:
64-
return '<li class="navbar-text">{user}</li>'.format(user=user)
64+
snippet = format_html('<li class="navbar-text">{user}</li>', user=escape(user))
65+
return mark_safe(snippet)
6566

6667
snippet = """<li class="dropdown">
6768
<a href="#" class="dropdown-toggle" data-toggle="dropdown">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy