From d3e33fff12266b51ab1488f7094855aef6061e9e Mon Sep 17 00:00:00 2001 From: Dmitro Date: Tue, 18 Feb 2014 13:25:39 +0200 Subject: [PATCH] Made content_type_extra optional for TemporaryUploadedFile and MemoryUploadedFile. This provides better backwards compatibility for those constructing these objects manually. Refs #13721. --- django/core/files/uploadedfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/files/uploadedfile.py b/django/core/files/uploadedfile.py index 7697e30333..75f25405b9 100644 --- a/django/core/files/uploadedfile.py +++ b/django/core/files/uploadedfile.py @@ -60,7 +60,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): + 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) @@ -89,7 +89,7 @@ class InMemoryUploadedFile(UploadedFile): """ A file uploaded into memory (i.e. stream-to-memory). """ - def __init__(self, file, field_name, name, content_type, size, charset, content_type_extra): + def __init__(self, file, field_name, name, content_type, size, charset, content_type_extra=None): super(InMemoryUploadedFile, self).__init__(file, name, content_type, size, charset, content_type_extra) self.field_name = field_name