Commit d474934d by Vladislav Vlastovskiy

Fixed return type

From bytes to str
parent f6329b7b
...@@ -10,6 +10,7 @@ from django.core.files.uploadhandler import StopFutureHandlers ...@@ -10,6 +10,7 @@ from django.core.files.uploadhandler import StopFutureHandlers
from django.http import QueryDict from django.http import QueryDict
from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser
from django.http.multipartparser import MultiPartParserError, parse_header, ChunkIter 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
from rest_framework.exceptions import ParseError from rest_framework.exceptions import ParseError
from rest_framework import renderers from rest_framework import renderers
...@@ -289,6 +290,6 @@ class FileUploadParser(BaseParser): ...@@ -289,6 +290,6 @@ class FileUploadParser(BaseParser):
try: try:
meta = parser_context['request'].META meta = parser_context['request'].META
disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode('utf-8')) disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode('utf-8'))
return disposition[1]['filename'] return force_str(disposition[1]['filename'])
except (AttributeError, KeyError): except (AttributeError, KeyError):
pass pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment