Skip to content

Commit

Permalink
Deprecate urlize_quoted_links in favor of Django's built-in urlize
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Sep 30, 2020
1 parent f3d9d68 commit 4121b01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rest_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

__title__ = 'Django REST framework'
__version__ = '3.11.1'
__version__ = '3.11.2'
__author__ = 'Tom Christie'
__license__ = 'BSD 3-Clause'
__copyright__ = 'Copyright 2011-2019 Encode OSS Ltd'
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def get_content(self, renderer, data,
if render_style == 'binary':
return '[%d bytes of binary content]' % len(content)

return content
return content.decode('utf-8') if isinstance(content, bytes) else content

def show_form_for_method(self, view, method, request, obj):
"""
Expand Down
6 changes: 3 additions & 3 deletions rest_framework/templates/rest_framework/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

<div class="region" aria-label="{% trans "request form" %}">
{% block request_forms %}

{% if 'GET' in allowed_methods %}
<form id="get-form" class="pull-right">
<fieldset>
Expand Down Expand Up @@ -176,9 +176,9 @@ <h1>{{ name }}</h1>

<div class="response-info" aria-label="{% trans "response info" %}">
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% for key, val in response_headers|items %}
<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>{% endfor %}
<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize }}</span>{% endfor %}

</span>{{ content|urlize_quoted_links }}</pre>
</span>{{ content|urlize }}</pre>
</div>
</div>

Expand Down

0 comments on commit 4121b01

Please sign in to comment.