From ba30e2f69feeba7258739a15d00c7c5d56a5f716 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 25 Jan 2021 14:32:08 +0000 Subject: [PATCH] . --- rapids/tables.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rapids/tables.py b/rapids/tables.py index 306f2627..edcebe21 100755 --- a/rapids/tables.py +++ b/rapids/tables.py @@ -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('No image') + + image_object = obj.image try: thumbnailer = get_thumbnailer(image_object) return format_html('', thumbnailer["exam-list"])