summaryrefslogtreecommitdiff
path: root/django/core/files/base.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2011-12-30 14:51:05 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2011-12-30 14:51:05 +0000
commitc458700382724e85d8572fc80cd829f54d57d43d (patch)
treef5b91f22da06f14c75922b75a69be8a74593d157 /django/core/files/base.py
parent27444618f6f8822110808a5d663a400334b8e9d7 (diff)
downloaddjango-c458700382724e85d8572fc80cd829f54d57d43d.tar.gz
Fixed #16590 -- Accepted a 'name' argument in the constructor of ContentFile, for consistency with File.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/files/base.py')
-rw-r--r--django/core/files/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/files/base.py b/django/core/files/base.py
index 6204d71040..48d0be43f0 100644
--- a/django/core/files/base.py
+++ b/django/core/files/base.py
@@ -122,9 +122,9 @@ class ContentFile(File):
"""
A File-like object that takes just raw content, rather than an actual file.
"""
- def __init__(self, content):
+ def __init__(self, content, name=None):
content = content or ''
- super(ContentFile, self).__init__(StringIO(content))
+ super(ContentFile, self).__init__(StringIO(content), name=name)
self.size = len(content)
def __str__(self):