This commit is contained in:
Ross
2021-01-25 14:32:08 +00:00
parent 21031945e7
commit ba30e2f69f
+6 -1
View File
@@ -12,7 +12,12 @@ from easy_thumbnails.exceptions import InvalidImageFormatError
class ImageColumn(tables.Column):
def render(self, value):
image_object = value.first().image
obj = value.first()
if obj is None:
return format_html('<span>No image<span>')
image_object = obj.image
try:
thumbnailer = get_thumbnailer(image_object)
return format_html('<img src="/media/{}" />', thumbnailer["exam-list"])