Ensure hero images are optional
This commit is contained in:
parent
f4fcac48cc
commit
3b51546fce
2 changed files with 26 additions and 1 deletions
|
@ -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",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -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 + [
|
||||||
|
|
Loading…
Reference in a new issue