Skip to content

Commit 9566352

Browse files
committed
Fix Internal Server Error when previewing blob image
1 parent 97d7216 commit 9566352

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

templates/store/snap-details/_snap_heading_data.html

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
{% if icon_url %}
2-
{{
3-
image(
4-
url=icon_url,
5-
alt=snap_title,
6-
width=60,
7-
height=60,
8-
hi_def=True,
9-
loading="eager",
10-
attrs={"class": "p-snap-heading__icon", "data-live": "icon"}
11-
) | safe
12-
}}
2+
{% if icon_url.startswith("blob") %}
3+
<img class="p-snap-heading__icon" src="{{ icon_url | safe }}" width="60" height="60" data-live="icon" />
4+
{% else %}
5+
{{
6+
image(
7+
url=icon_url,
8+
alt=snap_title,
9+
width=60,
10+
height=60,
11+
hi_def=True,
12+
loading="eager",
13+
attrs={"class": "p-snap-heading__icon", "data-live": "icon"}
14+
) | safe
15+
}}
16+
{% endif %}
1317
{% else %}
1418
<img class="p-snap-heading__icon" src="https://assets.ubuntu.com/v1/be6eb412-snapcraft-missing-icon.svg" alt="" data-live="icon" />
1519
{% endif %}

0 commit comments

Comments
 (0)