Ensure hero images are optional

This commit is contained in:
Jake Howard 2022-06-19 11:36:15 +01:00
parent f4fcac48cc
commit 3b51546fce
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,25 @@
# Generated by Django 4.0.5 on 2022-06-19 10:35
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailimages", "0024_index_image_file_hash"),
("common", "0002_contentpage_hero_image"),
]
operations = [
migrations.AlterField(
model_name="contentpage",
name="hero_image",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="wagtailimages.image",
),
),
]

View file

@ -21,7 +21,7 @@ class BasePage(Page):
class ContentPage(BasePage): class ContentPage(BasePage):
subtitle = models.CharField(max_length=255, blank=True) subtitle = models.CharField(max_length=255, blank=True)
hero_image = models.ForeignKey( hero_image = models.ForeignKey(
get_image_model_string(), null=True, on_delete=models.SET_NULL get_image_model_string(), null=True, blank=True, on_delete=models.SET_NULL
) )
content_panels = BasePage.content_panels + [ content_panels = BasePage.content_panels + [