фикс
This commit is contained in:
1 parent
7703e75b30
commit
089233135d
1 file changed
+2
-1
@@ -92,7 +92,8 @@ class BirthdayImageAdmin(admin.ModelAdmin):
|
|||||||
readonly_fields=('get_html_photo',)
|
readonly_fields=('get_html_photo',)
|
||||||
|
|
||||||
def get_html_photo(self, object):
|
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="Превью изображения"
|
get_html_photo.short_description="Превью изображения"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user