фикс
This commit is contained in:
1 parent
440dde38ee
commit
c57cad5cb1
3 files changed
+2
-1
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 195 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 195 KiB |
@@ -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