diff options
| author | Pablo Recio | 2013-05-18 16:32:53 +0200 |
|---|---|---|
| committer | Pablo Recio | 2013-05-18 17:06:54 +0200 |
| commit | 6dbbbc16da740fb27f9a5a390fb61400e9f6ff64 (patch) | |
| tree | a203fd17e85ebb5e8b5da34b0ba6530018be6977 /rest_framework | |
| parent | 97f034e3d65068f7bd1e982e6fd251222a4feea1 (diff) | |
| download | django-rest-framework-6dbbbc16da740fb27f9a5a390fb61400e9f6ff64.tar.bz2 | |
Better checking if the content can be printable in the BrowsableAPI
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/renderers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 12e1107f..4345a313 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -325,7 +325,7 @@ class BrowsableAPIRenderer(BaseRenderer): renderer_context['indent'] = 4 content = renderer.render(data, accepted_media_type, renderer_context) - if not all(char in string.printable for char in content): + if not isinstance(content, six.text_type): return '[%d bytes of binary content]' return content |
