Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made content_type_extra optional for TemporaryUploadedFile and Memory…

…UploadedFile.

This provides better backwards compatibility for those constructing these
objects manually.

Refs #13721.
  • Loading branch information...
commit d3e33fff12266b51ab1488f7094855aef6061e9e 1 parent 621c5cf
@YDS19872712 YDS19872712 authored timgraham committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/core/files/uploadedfile.py
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.