This commit is contained in:
Alex committed 2023-12-28 09:08:39 +03:00
1 parent 7703e75b30
commit 089233135d
1 file changed
+2 -1
+2 -1
View File
@@ -92,7 +92,8 @@ class BirthdayImageAdmin(admin.ModelAdmin):
readonly_fields=('get_html_photo',)
def get_html_photo(self, object):
return mark_safe(f"<img src='{object.img.url}' width=50>")
if object.img:
return mark_safe(f"<img src='{object.img.url}' width=50>")
get_html_photo.short_description="Превью изображения"