Deprecate urlize_quoted_links in favor of Django's built-in urlize

This commit is contained in:
Tom Christie 2020-09-30 09:15:46 +01:00
parent f3d9d68970
commit 4121b01b91
3 changed files with 5 additions and 5 deletions

View File

@ -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'

View File

@ -418,7 +418,7 @@ class BrowsableAPIRenderer(BaseRenderer):
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):
"""

View File

@ -176,9 +176,9 @@
<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>