Removed unnecessary check in TemporaryUploadedFile.
If settings.FILE_UPLOAD_TEMP_DIR is the default value of None, NamedTemporaryFile will work the same as if nothing was passed.
This commit is contained in:
parent
bb7bb379e8
commit
cd88faa628
|
@ -61,10 +61,7 @@ class TemporaryUploadedFile(UploadedFile):
|
||||||
A file uploaded to a temporary location (i.e. stream-to-disk).
|
A file uploaded to a temporary location (i.e. stream-to-disk).
|
||||||
"""
|
"""
|
||||||
def __init__(self, name, content_type, size, charset, content_type_extra=None):
|
def __init__(self, name, content_type, size, charset, content_type_extra=None):
|
||||||
if settings.FILE_UPLOAD_TEMP_DIR:
|
file = tempfile.NamedTemporaryFile(suffix='.upload', dir=settings.FILE_UPLOAD_TEMP_DIR)
|
||||||
file = tempfile.NamedTemporaryFile(suffix='.upload', dir=settings.FILE_UPLOAD_TEMP_DIR)
|
|
||||||
else:
|
|
||||||
file = tempfile.NamedTemporaryFile(suffix='.upload')
|
|
||||||
super(TemporaryUploadedFile, self).__init__(file, name, content_type, size, charset, content_type_extra)
|
super(TemporaryUploadedFile, self).__init__(file, name, content_type, size, charset, content_type_extra)
|
||||||
|
|
||||||
def temporary_file_path(self):
|
def temporary_file_path(self):
|
||||||
|
|
Loading…
Reference in New Issue