aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorTom Christie2014-09-06 07:05:27 +0100
committerTom Christie2014-09-06 07:05:27 +0100
commitc419fb0f9e395e805a04b9a8c28709a0b6deba31 (patch)
treec64605e2ea2d9138f27a604d0cacb657a527bb37 /rest_framework
parentf4e02446f99cef42f18f57a2712c435a84451868 (diff)
parent97ebd68f681961fb7e3f785e3cb84a69b3dc56aa (diff)
downloaddjango-rest-framework-c419fb0f9e395e805a04b9a8c28709a0b6deba31.tar.bz2
Merge pull request #1841 from jpadilla/view-description-as-promise
Supported translated text view descriptions
Diffstat (limited to 'rest_framework')
-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()]