diff options
| author | José Padilla | 2014-09-05 15:34:16 -0700 |
|---|---|---|
| committer | José Padilla | 2014-09-05 15:34:16 -0700 |
| commit | d44a8f24ff56d65705580f9c2373175c93c2f4d8 (patch) | |
| tree | 0d8653e27dab1fddf2b79d6bcc1346bec37ddbc3 /rest_framework/utils/formatting.py | |
| parent | f4e02446f99cef42f18f57a2712c435a84451868 (diff) | |
| parent | 3e93c96ece8af010185e1fe1188dd2df569d4528 (diff) | |
| download | django-rest-framework-d44a8f24ff56d65705580f9c2373175c93c2f4d8.tar.bz2 | |
Merge remote-tracking branch 'poswald/view-description-as-promise' into view-description-as-promise
Diffstat (limited to 'rest_framework/utils/formatting.py')
| -rw-r--r-- | rest_framework/utils/formatting.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rest_framework/utils/formatting.py b/rest_framework/utils/formatting.py index 6d53aed1..bca697ae 100644 --- a/rest_framework/utils/formatting.py +++ b/rest_framework/utils/formatting.py @@ -5,6 +5,8 @@ from __future__ import unicode_literals from django.utils.html import escape from django.utils.safestring import mark_safe +from django.utils.encoding import force_text + from rest_framework.compat import apply_markdown import re @@ -28,6 +30,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()] |
