diff options
| author | Vladislav Vlastovskiy | 2014-04-14 13:21:24 +0400 | 
|---|---|---|
| committer | Vladislav Vlastovskiy | 2014-04-14 13:21:24 +0400 | 
| commit | 3fe038357267f947eba467f2b7714a782fa93c33 (patch) | |
| tree | 3ad1f23da73014adcb9ac7ea0a4560a0c0bcc23f /rest_framework/parsers.py | |
| parent | d1f4dfca2061cb552158ac7ea6f2de609989797b (diff) | |
| download | django-rest-framework-3fe038357267f947eba467f2b7714a782fa93c33.tar.bz2 | |
Fixed convert bytes to str
Use compact function for convert
Diffstat (limited to 'rest_framework/parsers.py')
| -rw-r--r-- | rest_framework/parsers.py | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index d49b17a4..4990971b 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -10,8 +10,7 @@ from django.core.files.uploadhandler import StopFutureHandlers  from django.http import QueryDict  from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser  from django.http.multipartparser import MultiPartParserError, parse_header, ChunkIter -from django.utils.encoding import force_str -from rest_framework.compat import etree, six, yaml +from rest_framework.compat import etree, six, yaml, force_text  from rest_framework.exceptions import ParseError  from rest_framework import renderers  import json @@ -290,6 +289,6 @@ class FileUploadParser(BaseParser):          try:              meta = parser_context['request'].META              disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode('utf-8')) -            return force_str(disposition[1]['filename']) +            return force_text(disposition[1]['filename'])          except (AttributeError, KeyError):              pass | 
