Skip to content

Commit 4bc69da

Browse files
authored
add sha256 for release files (#2830)
1 parent f369974 commit 4bc69da

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

downloads/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Meta(GenericResource.Meta):
6868
'name', 'slug',
6969
'creator', 'last_modified_by',
7070
'os', 'release', 'description', 'is_source', 'url', 'gpg_signature_file',
71-
'md5_sum', 'filesize', 'download_button', 'sigstore_signature_file',
71+
'md5_sum', 'sha256_sum', 'filesize', 'download_button', 'sigstore_signature_file',
7272
'sigstore_cert_file', 'sigstore_bundle_file', 'sbom_spdx2_file',
7373
]
7474
filtering = {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.26 on 2025-11-27 16:45
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('downloads', '0013_alter_release_content_markup_type'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='releasefile',
15+
name='sha256_sum',
16+
field=models.CharField(blank=True, max_length=200, verbose_name='SHA256 Sum'),
17+
),
18+
]

downloads/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ class ReleaseFile(ContentManageable, NameSlugModel):
360360
"SPDX-2 SBOM URL", blank=True, help_text="SPDX-2 SBOM URL"
361361
)
362362
md5_sum = models.CharField('MD5 Sum', max_length=200, blank=True)
363+
sha256_sum = models.CharField('SHA256 Sum', max_length=200, blank=True)
363364
filesize = models.IntegerField(default=0)
364365
download_button = models.BooleanField(default=False, help_text="Use for the supernav download button for this OS")
365366

downloads/serializers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class Meta:
4343
'url',
4444
'gpg_signature_file',
4545
'md5_sum',
46+
'sha256_sum',
4647
'filesize',
4748
'download_button',
4849
'resource_uri',

templates/downloads/release_detail.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ <h3>{{ f.os.name }}</h3>
7474
<th>Version</th>
7575
<th>Operating System</th>
7676
<th>Description</th>
77-
<th>MD5 Sum</th>
77+
<th>MD5 Checksum</th>
78+
<th>SHA256 Checksum</th>
7879
<th>File Size</th>
7980
{% if release_files|has_sigstore_materials %}
8081
<th colspan="2"><a href="https://www.python.org/download/sigstore/">Sigstore</a></th>
@@ -94,6 +95,7 @@ <h3>{{ f.os.name }}</h3>
9495
<td>{{ f.os.name }}</td>
9596
<td>{{ f.description }}</td>
9697
<td>{{ f.md5_sum }}</td>
98+
<td>{{ f.sha256_sum|default:"n/a" }}</td>
9799
<td>{{ f.filesize|filesizeformat }}</td>
98100
{% if release_files|has_sigstore_materials %}
99101
{% if f.sigstore_bundle_file %}

0 commit comments

Comments
 (0)