diff --git a/easy_thumbnails/files.py b/easy_thumbnails/files.py index 5e6cd89..8e0ee56 100644 --- a/easy_thumbnails/files.py +++ b/easy_thumbnails/files.py @@ -423,8 +423,9 @@ def get_thumbnail_name(self, thumbnail_options, transparent=False): """ thumbnail_options = self.get_options(thumbnail_options) path, source_filename = os.path.split(self.name) - # remove storage location - path = path.replace(self.source_storage.location, '') + if hasattr(self.source_storage, 'location'): # remote storages do not have the location attribute + # remove storage location + path = path.replace(self.source_storage.location, '') # remove leading slash if present path = path.lstrip('/') source_extension = os.path.splitext(source_filename)[1][1:].lower()