tidy up table image dlocks

This commit is contained in:
Ross
2023-06-12 12:34:38 +01:00
parent e0f0c7619a
commit d1ba8c87dc
10 changed files with 66 additions and 154 deletions
+2 -1
View File
@@ -194,6 +194,7 @@ class SeriesBase(models.Model):
else:
# This is a mess...
return format_html('", "'.join(images))
def get_thumbnail(self):
images = self.images.all()
@@ -205,7 +206,7 @@ class SeriesBase(models.Model):
thumbnailer = get_thumbnailer(img)
thumbnail = thumbnailer["exam-list"]
except InvalidImageFormatError:
return format_html('<span title="{}">Invalid image url<span>', img), len(
return format_html('<img title="{}" src="/static/not-found-image.jpg" />', img), len(
images
)
return format_html('<img src="/media/{}" />', thumbnail), len(images)