You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method Thumbnailer.get_thumbnail_name breaks when using non-filesystem storages such as S3 storage (e.g. with django-s3-storage).
The reason is that the method presumes the existence of .location on the storage object, which is not always the case for the Django file storage API. Only FileSystemStorage and MemoryStorage have this attribute, remote storages don't.
Instead, a different lookup should be done for when remote storage is used. You already apply this concept in another place in this project; in _get_absolute_path, so I think the same should be done for the get_thumbnail_name method.
This should fix this error if anybody comes across it:
'S3Storage' object has no attribute 'location'
The text was updated successfully, but these errors were encountered:
The method Thumbnailer.get_thumbnail_name breaks when using non-filesystem storages such as S3 storage (e.g. with
django-s3-storage
).The reason is that the method presumes the existence of
.location
on the storage object, which is not always the case for the Django file storage API. Only FileSystemStorage and MemoryStorage have this attribute, remote storages don't.Instead, a different lookup should be done for when remote storage is used. You already apply this concept in another place in this project; in _get_absolute_path, so I think the same should be done for the
get_thumbnail_name
method.This should fix this error if anybody comes across it:
The text was updated successfully, but these errors were encountered: