david / django-storages

Support for many storages (S3, MogileFS, etc) in Django.

Clone this repository (size: 177.1 KB): HTTPS / SSH
$ hg clone http://code.welldev.org/django-storages
commit 71: 2180945212ec
parent 70: 5fa7267dc86a
branch: default
Return empty string when we try to get the URL of a key that doesn't exist in the bucket
Gert Van Gool / gvangool
6 months ago

Changed (Δ68 bytes):

raw changeset »

backends/s3boto.py (2 lines added, 0 lines removed)

Up to file-list backends/s3boto.py:

@@ -103,6 +103,8 @@ class S3BotoStorage(Storage):
103
103
104
104
    def url(self, name):
105
105
        name = self._clean_name(name)
106
        if self.bucket.get_key(name) is None:
107
            return ''
106
108
        return self.bucket.get_key(name).generate_url(QUERYSTRING_EXPIRE, method='GET', query_auth=QUERYSTRING_AUTH)
107
109
108
110
    def get_available_name(self, name):