aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/formatting.py
diff options
context:
space:
mode:
authorTom Christie2014-09-11 13:20:44 +0100
committerTom Christie2014-09-11 13:20:44 +0100
commitde301f3b6647e1c79a506405a88071ef977418d1 (patch)
tree407f3497b422f334b47088b0bb35d39a8a3a520a /rest_framework/utils/formatting.py
parent80ba0473473501968154c5cc5dd5922e53d96a70 (diff)
parent015a8122c7738dd8913939b42d3f0ec932d88711 (diff)
downloaddjango-rest-framework-de301f3b6647e1c79a506405a88071ef977418d1.tar.bz2
Merge master
Diffstat (limited to 'rest_framework/utils/formatting.py')
-rw-r--r--rest_framework/utils/formatting.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/rest_framework/utils/formatting.py b/rest_framework/utils/formatting.py
index 6d53aed1..470af51b 100644
--- a/rest_framework/utils/formatting.py
+++ b/rest_framework/utils/formatting.py
@@ -2,11 +2,12 @@
Utility functions to return a formatted name and description for a given view.
"""
from __future__ import unicode_literals
+import re
from django.utils.html import escape
from django.utils.safestring import mark_safe
-from rest_framework.compat import apply_markdown
-import re
+
+from rest_framework.compat import apply_markdown, force_text
def remove_trailing_string(content, trailing):
@@ -28,6 +29,7 @@ def dedent(content):
as it fails to dedent multiline docstrings that include
unindented text on the initial line.
"""
+ content = force_text(content)
whitespace_counts = [len(line) - len(line.lstrip(' '))
for line in content.splitlines()[1:] if line.lstrip()]