diff options
| author | jason | 2010-10-26 18:31:45 -0600 |
|---|---|---|
| committer | jason | 2010-10-26 18:31:45 -0600 |
| commit | 5e040ecd4902d7c46856419368e2e14a685f068b (patch) | |
| tree | 652e19825d4bf18f26e2454f29451cb1a438a95e /django/__init__.py | |
| parent | c123920cfe59b8465153ab695ba10f5b263554ab (diff) | |
| download | amazons3-py-5e040ecd4902d7c46856419368e2e14a685f068b.tar.gz amazons3-py-5e040ecd4902d7c46856419368e2e14a685f068b.zip | |
Added an exception to allow pragmatically uploading files using the s3 django module
Diffstat (limited to 'django/__init__.py')
| -rw-r--r-- | django/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/__init__.py b/django/__init__.py index 9f9836c..49317a1 100644 --- a/django/__init__.py +++ b/django/__init__.py | |||
| @@ -65,7 +65,11 @@ class S3Storage(Storage): | |||
| 65 | 65 | ||
| 66 | def _save(self, filename, content): | 66 | def _save(self, filename, content): |
| 67 | # a stupid hack | 67 | # a stupid hack |
| 68 | content = content.file | 68 | try: |
| 69 | content.url = self.url | ||
| 70 | except AttributeError, e: | ||
| 71 | content = content.file | ||
| 72 | |||
| 69 | try: | 73 | try: |
| 70 | data = content.read() | 74 | data = content.read() |
| 71 | except IOError, err: | 75 | except IOError, err: |