Fixed #7590: made UploadedFile subclasses' __init__ methods sane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7817 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b0a38160ca
commit
9fc4c0aaa4
|
@ -140,9 +140,13 @@ class TemporaryFileUploadHandler(FileUploadHandler):
|
||||||
|
|
||||||
def file_complete(self, file_size):
|
def file_complete(self, file_size):
|
||||||
self.file.seek(0)
|
self.file.seek(0)
|
||||||
return TemporaryUploadedFile(self.file, self.file_name,
|
return TemporaryUploadedFile(
|
||||||
self.content_type, file_size,
|
file = self.file,
|
||||||
self.charset)
|
file_name = self.file_name,
|
||||||
|
content_type = self.content_type,
|
||||||
|
file_size = file_size,
|
||||||
|
charset = self.charset
|
||||||
|
)
|
||||||
|
|
||||||
class MemoryFileUploadHandler(FileUploadHandler):
|
class MemoryFileUploadHandler(FileUploadHandler):
|
||||||
"""
|
"""
|
||||||
|
@ -182,8 +186,14 @@ class MemoryFileUploadHandler(FileUploadHandler):
|
||||||
if not self.activated:
|
if not self.activated:
|
||||||
return
|
return
|
||||||
|
|
||||||
return InMemoryUploadedFile(self.file, self.field_name, self.file_name,
|
return InMemoryUploadedFile(
|
||||||
self.content_type, self.charset, file_size)
|
file = self.file,
|
||||||
|
field_name = self.field_name,
|
||||||
|
file_name = self.file_name,
|
||||||
|
content_type = self.content_type,
|
||||||
|
file_size = file_size,
|
||||||
|
charset = self.charset
|
||||||
|
)
|
||||||
|
|
||||||
class TemporaryFile(object):
|
class TemporaryFile(object):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue