From 253c401ae280c40d1d84868c56b90e4100616498 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Sat, 9 Nov 2024 00:02:19 +0000 Subject: [PATCH] Pass InlinePanel heading rather than label to use as the label for comparisons Conventionally `label` is singular (used on individual forms as "Speaker 1", "Speaker 2" etc as well as the "Add speaker" button), while `heading` is plural ("Speakers" or "Speaker lineup", used as the main heading for the list). The plural is most appropriate for the comparison view. Also fix the test for MultipleChooserPanel, which was copied across from the InlinePanel test without actually setting a label/heading on the panel. --- wagtail/admin/panels/inline_panel.py | 2 +- wagtail/admin/tests/pages/test_edit_page.py | 2 +- wagtail/admin/tests/test_edit_handlers.py | 6 +++--- wagtail/test/testapp/models.py | 6 ++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wagtail/admin/panels/inline_panel.py b/wagtail/admin/panels/inline_panel.py index c353ec44ec..b2e9f3eaea 100644 --- a/wagtail/admin/panels/inline_panel.py +++ b/wagtail/admin/panels/inline_panel.py @@ -150,7 +150,7 @@ class InlinePanel(Panel): compare.ChildRelationComparison, self.panel.db_field, field_comparisons, - label=self.label, + label=self.heading, ) ] diff --git a/wagtail/admin/tests/pages/test_edit_page.py b/wagtail/admin/tests/pages/test_edit_page.py index a9963eed25..ff161fedff 100644 --- a/wagtail/admin/tests/pages/test_edit_page.py +++ b/wagtail/admin/tests/pages/test_edit_page.py @@ -167,7 +167,7 @@ class TestPageEdit(WagtailTestUtils, TestCase): response, '