aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/storage/cloudfiles.py
diff options
context:
space:
mode:
authorJoar Wandborg <git@wandborg.com>2012-10-23 01:09:09 +0200
committerJoar Wandborg <git@wandborg.com>2012-10-23 01:10:46 +0200
commitc43f8c1d927c7b01d70bdd5662848fa3009f1141 (patch)
tree15fac419a83f7946c4c4fa8771ffb418960c64a3 /mediagoblin/storage/cloudfiles.py
parentd7d9933735d7a0b4339e1a4e6bebe169ba9f4f9a (diff)
downloadmediagoblin-c43f8c1d927c7b01d70bdd5662848fa3009f1141.tar.lz
mediagoblin-c43f8c1d927c7b01d70bdd5662848fa3009f1141.tar.xz
mediagoblin-c43f8c1d927c7b01d70bdd5662848fa3009f1141.zip
Fixed attachments
Diffstat (limited to 'mediagoblin/storage/cloudfiles.py')
-rw-r--r--mediagoblin/storage/cloudfiles.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mediagoblin/storage/cloudfiles.py b/mediagoblin/storage/cloudfiles.py
index ced3beb3..1b5a6363 100644
--- a/mediagoblin/storage/cloudfiles.py
+++ b/mediagoblin/storage/cloudfiles.py
@@ -104,10 +104,13 @@ class CloudFilesStorage(StorageInterface):
mimetype = mimetypes.guess_type(
filepath[-1])
- if mimetype:
+ if mimetype[0]:
# Set the mimetype on the CloudFiles object
obj.content_type = mimetype[0]
obj.metadata = {'mime-type': mimetype[0]}
+ else:
+ obj.content_type = 'application/octet-stream'
+ obj.metadata = {'mime-type': 'application/octet-stream'}
return CloudFilesStorageObjectWrapper(obj, *args, **kwargs)