Skip to content

Commit c48608a

Browse files
authored
Fix use of non-dynamic image class in migrations (#600)
At some point, a few migrations slipped through referencing the concrete Image model. This of course breaks any site trying to use its own image model.
1 parent 07721e3 commit c48608a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

coderedcms/migrations/0022_auto_20210731_1853.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from django.db import migrations, models
44
import django.db.models.deletion
5+
from wagtail.images import get_image_model_string
56

67

78
class Migration(migrations.Migration):
@@ -20,7 +21,7 @@ class Migration(migrations.Migration):
2021
migrations.AlterField(
2122
model_name='coderedpage',
2223
name='og_image',
23-
field=models.ForeignKey(blank=True, help_text='Shown when linking to this page on social media.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image', verbose_name='Preview image'),
24+
field=models.ForeignKey(blank=True, help_text='Shown when linking to this page on social media.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=get_image_model_string(), verbose_name='Preview image'),
2425
),
2526
migrations.AlterField(
2627
model_name='coderedpage',

coderedcms/migrations/0036_filmstrip_filmpanel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.db import migrations, models
55
import django.db.models.deletion
66
import modelcluster.fields
7+
from wagtail.images import get_image_model_string
78

89

910
class Migration(migrations.Migration):
@@ -92,7 +93,7 @@ class Migration(migrations.Migration):
9293
null=True,
9394
on_delete=django.db.models.deletion.SET_NULL,
9495
related_name="+",
95-
to="wagtailimages.image",
96+
to=get_image_model_string(),
9697
verbose_name="Background image",
9798
),
9899
),

0 commit comments

Comments
 (0)