From afe12af07f210ada0b048ef3efb3baeb540ab2dd Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 7 Jan 2010 10:14:43 -0700 Subject: Removed a hack that was breaking stuff --- django/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/django/__init__.py b/django/__init__.py index 7027c19..159a552 100644 --- a/django/__init__.py +++ b/django/__init__.py @@ -61,13 +61,19 @@ class S3Storage(Storage): def _save(self, filename, content): # a stupid hack - content = content.file + #content = content.file try: data = content.read() except IOError, err: raise S3Error, 'Unable to read %s: %s' % (filename, err.strerror) - if not content.content_type: + guess_type = False + try: + content.content_type + except AttributeError, e: + guess_type = True + + if guess_type or not content.content_type: import mimetypes content_type = mimetypes.guess_type(filename)[0] if content_type is None: -- cgit v1.2.1