From 90a190f42afd7bdd33c06ae41ed5aa477c9a32e0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 21 Nov 2024 14:39:45 -0800 Subject: [PATCH] Add release_report_cover_image to Version - fixes #1467 - add an ImageField to the Version model to be used in the release report --- templates/admin/release_report_detail.html | 10 +++++++++- ...0013_version_release_report_cover_image.py | 20 +++++++++++++++++++ versions/models.py | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 versions/migrations/0013_version_release_report_cover_image.py diff --git a/templates/admin/release_report_detail.html b/templates/admin/release_report_detail.html index 7651d53b..3faab009 100644 --- a/templates/admin/release_report_detail.html +++ b/templates/admin/release_report_detail.html @@ -55,7 +55,15 @@

Boost

{% endif %} -
+
+ + {% if version.release_report_cover_image.url %} + release report cover image + {% endif %} {% if contribution_box_graph %}
diff --git a/versions/migrations/0013_version_release_report_cover_image.py b/versions/migrations/0013_version_release_report_cover_image.py new file mode 100644 index 00000000..82dff8dc --- /dev/null +++ b/versions/migrations/0013_version_release_report_cover_image.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.16 on 2024-11-21 20:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("versions", "0012_review_reviewresult"), + ] + + operations = [ + migrations.AddField( + model_name="version", + name="release_report_cover_image", + field=models.ImageField( + blank=True, null=True, upload_to="release_report_cover/" + ), + ), + ] diff --git a/versions/models.py b/versions/models.py index 6a070666..d012dfa5 100755 --- a/versions/models.py +++ b/versions/models.py @@ -36,6 +36,11 @@ class Version(models.Model): "beta release or a development version", ) data = models.JSONField(default=dict) + release_report_cover_image = models.ImageField( + null=True, + blank=True, + upload_to="release_report_cover/", + ) objects = VersionManager()