Skip to content

Commit bc51c60

Browse files
authored
Hide GPG column if no GPG signatures in release (#2656)
1 parent 452480d commit bc51c60

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: downloads/templatetags/download_tags.py

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ def strip_minor_version(version):
88
return '.'.join(version.split('.')[:2])
99

1010

11+
@register.filter
12+
def has_gpg(files: list) -> bool:
13+
return any(f.gpg_signature_file for f in files)
14+
15+
1116
@register.filter
1217
def has_sigstore_materials(files):
1318
return any(

Diff for: templates/downloads/release_detail.html

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends "base.html" %}
22
{% load boxes %}
33
{% load sitetree %}
4+
{% load has_gpg from download_tags %}
45
{% load has_sigstore_materials from download_tags %}
56
{% load has_sbom from download_tags %}
67
{% load sort_windows from download_tags %}
@@ -51,7 +52,9 @@ <h1 class="page-title">Files</h1>
5152
<th>Description</th>
5253
<th>MD5 Sum</th>
5354
<th>File Size</th>
55+
{% if release_files|has_gpg %}
5456
<th>GPG</th>
57+
{% endif %}
5558
{% if release_files|has_sigstore_materials %}
5659
<th colspan="2"><a href="https://www.python.org/download/sigstore/">Sigstore</a></th>
5760
{% endif %}
@@ -68,7 +71,9 @@ <h1 class="page-title">Files</h1>
6871
<td>{{ f.description }}</td>
6972
<td>{{ f.md5_sum }}</td>
7073
<td>{{ f.filesize|filesizeformat }}</td>
74+
{% if release_files|has_gpg %}
7175
<td>{% if f.gpg_signature_file %}<a href="{{ f.gpg_signature_file }}">SIG</a>{% endif %}</td>
76+
{% endif %}
7277
{% if release_files|has_sigstore_materials %}
7378
{% if f.sigstore_bundle_file %}
7479
<td colspan="2">{% if f.sigstore_bundle_file %}<a href="{{ f.sigstore_bundle_file}}">.sigstore</a>{% endif %}</td>

0 commit comments

Comments
 (0)