Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnailer.get_thumbnail_name breaks on non-filesystem storage #643

Open
CedricCook opened this issue Sep 4, 2024 · 0 comments · May be fixed by #654
Open

Thumbnailer.get_thumbnail_name breaks on non-filesystem storage #643

CedricCook opened this issue Sep 4, 2024 · 0 comments · May be fixed by #654

Comments

@CedricCook
Copy link

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'
@steven-jeanneret steven-jeanneret linked a pull request Nov 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant