Skip to content

Commit 95a1a81

Browse files
authored
update img tag
1 parent 619715f commit 95a1a81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

admin_extended/mixins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66

77
class UIUtilsMixin:
8-
def get_html_img_tag(self, url, height='200px'):
8+
def get_html_img_tag(self, url, href=None, height='200px'):
99
if url:
10+
if href:
11+
return format_html('<a href="{}" target="_blank"><img height="{}" src="{}" /></a>', href, height, url)
1012
return format_html('<img height="{}" src="{}" />', height, url)
1113
return self.get_empty_value_display()
1214

0 commit comments

Comments
 (0)