Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions downloads/templatetags/download_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ def has_sbom(files):
return any(f.sbom_spdx2_file for f in files)


@register.filter
def has_md5(files):
return any(f.md5_sum for f in files)


@register.filter
def has_sha256(files):
return any(f.sha256_sum for f in files)


@register.filter
def sort_windows(files):
if not files:
Expand Down
20 changes: 14 additions & 6 deletions templates/downloads/release_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
{% load has_gpg from download_tags %}
{% load has_sigstore_materials from download_tags %}
{% load has_sbom from download_tags %}
{% load has_md5 from download_tags %}
{% load has_sha256 from download_tags %}
{% load sort_windows from download_tags %}
{% load get_eol_info from download_tags %}

Expand Down Expand Up @@ -85,11 +87,9 @@ <h3>{{ f.os.name }}</h3>
<thead>
<tr>
<th>Version</th>
<th>Operating System</th>
<th>Operating system</th>
<th>Description</th>
<th>MD5 Checksum</th>
<th>SHA256 Checksum</th>
<th>File Size</th>
<th>File size</th>
{% if release_files|has_sigstore_materials %}
<th colspan="2"><a href="https://www.python.org/download/sigstore/">Sigstore</a></th>
{% endif %}
Expand All @@ -99,6 +99,11 @@ <h3>{{ f.os.name }}</h3>
{% if release_files|has_gpg %}
<th><a href="https://www.python.org/downloads/#gpg">GPG</a></th>
{% endif %}
{% if release_files|has_sha256 %}
<th>SHA-256 checksum</th>
{% elif release_files|has_md5 %}
<th>MD5 checksum</th>
{% endif %}
</tr>
</thead>
<tbody>
Expand All @@ -107,8 +112,6 @@ <h3>{{ f.os.name }}</h3>
<td><a href="{{ f.url }}">{{ f.name }}</a></td>
<td>{{ f.os.name }}</td>
<td>{{ f.description }}</td>
<td>{{ f.md5_sum }}</td>
<td>{{ f.sha256_sum|default:"n/a" }}</td>
<td>{{ f.filesize|filesizeformat }}</td>
{% if release_files|has_sigstore_materials %}
{% if f.sigstore_bundle_file %}
Expand All @@ -124,6 +127,11 @@ <h3>{{ f.os.name }}</h3>
{% if release_files|has_gpg %}
<td>{% if f.gpg_signature_file %}<a href="{{ f.gpg_signature_file }}">SIG</a>{% endif %}</td>
{% endif %}
{% if release_files|has_sha256 %}
<td>{{ f.sha256_sum }}</td>
{% elif release_files|has_md5 %}
<td>{{ f.md5_sum }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
Expand Down