mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
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.
This commit is contained in:
parent
6aef157daa
commit
0d568ed59f
|
@ -61,7 +61,8 @@ def optional_logout(request, user):
|
|||
try:
|
||||
logout_url = reverse('rest_framework:logout')
|
||||
except NoReverseMatch:
|
||||
return '<li class="navbar-text">{user}</li>'.format(user=user)
|
||||
snippet = format_html('<li class="navbar-text">{user}</li>', user=escape(user))
|
||||
return mark_safe(snippet)
|
||||
|
||||
snippet = """<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
|
|
Loading…
Reference in New Issue
Block a user