From e7dd00e4270a2e8b0bd30a1bdc765142206bcb19 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 15 Nov 2024 14:21:28 +0000 Subject: [PATCH] Ensure that creation of image/document choose permissions happens after access_admin permission exists As per https://github.com/wagtail/wagtail/issues/12581#issuecomment-2478983521. Fixes #12581 --- CHANGELOG.txt | 1 + docs/releases/6.4.md | 1 + wagtail/documents/migrations/0011_add_choose_permissions.py | 1 + wagtail/images/migrations/0023_add_choose_permissions.py | 1 + 4 files changed, 4 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 345ff32915..7c36db236d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Changelog * Fix: Ensure form builder supports custom admin form validation (John-Scott Atlakson, LB (Ben) Johnston) * Fix: Ensure form builder correctly checks for duplicate field names when using a custom related name (John-Scott Atlakson, LB (Ben) Johnston) * Fix: Normalize `StreamField.get_default()` to prevent creation forms from breaking (Matt Westcott) + * Fix: Prevent out-of-order migrations from skipping creation of image/document choose permissions (Matt Westcott) * Docs: Move the model reference page from reference/pages to the references section as it covers all Wagtail core models (Srishti Jaiswal) * Docs: Move the panels reference page from references/pages to the references section as panels are available for any model editing, merge panels API into this page (Srishti Jaiswal) * Docs: Move the tags documentation to standalone advanced topic, instead of being inside the reference/pages section (Srishti Jaiswal) diff --git a/docs/releases/6.4.md b/docs/releases/6.4.md index 598ce06c75..cad15e8054 100644 --- a/docs/releases/6.4.md +++ b/docs/releases/6.4.md @@ -30,6 +30,7 @@ depth: 1 * Ensure form builder supports custom admin form validation (John-Scott Atlakson, LB (Ben) Johnston) * Ensure form builder correctly checks for duplicate field names when using a custom related name (John-Scott Atlakson, LB (Ben) Johnston) * Normalize `StreamField.get_default()` to prevent creation forms from breaking (Matt Westcott) + * Prevent out-of-order migrations from skipping creation of image/document choose permissions (Matt Westcott) ### Documentation diff --git a/wagtail/documents/migrations/0011_add_choose_permissions.py b/wagtail/documents/migrations/0011_add_choose_permissions.py index a96589f8b9..17c6b1f2ff 100644 --- a/wagtail/documents/migrations/0011_add_choose_permissions.py +++ b/wagtail/documents/migrations/0011_add_choose_permissions.py @@ -80,6 +80,7 @@ class Migration(migrations.Migration): dependencies = [ ("wagtaildocs", "0010_document_file_hash"), + ("wagtailadmin", "0001_create_admin_access_permissions"), ] operations = [ diff --git a/wagtail/images/migrations/0023_add_choose_permissions.py b/wagtail/images/migrations/0023_add_choose_permissions.py index 5648ac6b7a..ae92bc0342 100644 --- a/wagtail/images/migrations/0023_add_choose_permissions.py +++ b/wagtail/images/migrations/0023_add_choose_permissions.py @@ -80,6 +80,7 @@ class Migration(migrations.Migration): dependencies = [ ("wagtailimages", "0022_uploadedimage"), + ("wagtailadmin", "0001_create_admin_access_permissions"), ] operations = [