Fix an internal server error

This commit is contained in:
tcely 2025-02-22 14:45:53 -05:00 committed by GitHub
parent 1f0169ae4b
commit 0d73519946
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -495,8 +495,9 @@ class MediaThumbView(DetailView):
def get(self, request, *args, **kwargs):
media = self.get_object()
if media.thumb:
thumb = open(media.thumb.path, 'rb').read()
if media.thumb_file_exists:
thumb_path = pathlib.Path(media.thumb.path)
thumb = thumb_path.read_bytes()
content_type = 'image/jpeg'
else:
# No thumbnail on disk, return a blank 1x1 gif