-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add backwards-compatible locale verbose_name migration (#72)
* Add backwards-compatible locale verbose_name migration Wagtail 6.2 alters the Locale model on TranslatableMixin, adding a verbose_name. Because Footnote inherits from TranslatableMixin, it needs a new migration generated for Wagtail 6.2. To maintain compatibility with Wagtail <= 6.1, this change makes the migration a noop. See #71 for context. * Remove Wagtail 6.0 from test matrix Co-authored-by: Dan Braghiș <[email protected]>
- Loading branch information
1 parent
15b55aa
commit eb0795c
Showing
2 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
wagtail_footnotes/migrations/0006_alter_footnote_locale.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 4.2.14 on 2024-08-12 17:41 | ||
import django.db.models.deletion | ||
|
||
from django.db import migrations, models | ||
from wagtail import VERSION as WAGTAIL_VERSION | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("wagtailcore", "0094_alter_page_locale"), | ||
( | ||
"wagtail_footnotes", | ||
"0005_alter_footnote_locale_alter_footnote_translation_key", | ||
), | ||
] | ||
|
||
operations = [] | ||
|
||
if WAGTAIL_VERSION >= (6, 2): | ||
operations.append( | ||
migrations.AlterField( | ||
model_name="footnote", | ||
name="locale", | ||
field=models.ForeignKey( | ||
editable=False, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="+", | ||
to="wagtailcore.locale", | ||
verbose_name="locale", | ||
), | ||
) | ||
) |