mirror of https://github.com/django/django.git
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).
|
||||
"""
|
||||
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)
|
||||
else:
|
||||
file = tempfile.NamedTemporaryFile(suffix='.upload')
|
||||
file = tempfile.NamedTemporaryFile(suffix='.upload', dir=settings.FILE_UPLOAD_TEMP_DIR)
|
||||
super(TemporaryUploadedFile, self).__init__(file, name, content_type, size, charset, content_type_extra)
|
||||
|
||||
def temporary_file_path(self):
|
||||
|
|
Loading…
Reference in New Issue