mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-21 05:21:54 +00:00
Revert "Issue 4334: Excluded fields are also excluded when a panel set is exp… (#4363)"
This reverts commit 6b272c43e4.
Conflicts:
wagtail/admin/tests/test_edit_handlers.py
This commit is contained in:
parent
8acb004a9f
commit
6ccd665e5e
2 changed files with 1 additions and 15 deletions
|
|
@ -64,16 +64,7 @@ def get_form_for_model(
|
|||
|
||||
def extract_panel_definitions_from_model_class(model, exclude=None):
|
||||
if hasattr(model, 'panels'):
|
||||
panels = model.panels
|
||||
|
||||
if exclude is not None:
|
||||
# Filter out fields in exclude
|
||||
panels = [
|
||||
panel for panel in panels
|
||||
if isinstance(panel, FieldPanel) and panel.field_name not in exclude
|
||||
]
|
||||
|
||||
return panels
|
||||
return model.panels
|
||||
|
||||
panels = []
|
||||
|
||||
|
|
|
|||
|
|
@ -209,11 +209,6 @@ class TestExtractPanelDefinitionsFromModelClass(TestCase):
|
|||
for panel in panels:
|
||||
self.assertNotEqual(panel.field_name, 'hostname')
|
||||
|
||||
def test_exclude_with_defined_panels(self):
|
||||
Site.panels = [FieldPanel('hostname')]
|
||||
panels = extract_panel_definitions_from_model_class(Site, exclude=['hostname'])
|
||||
self.assertEqual([], panels)
|
||||
|
||||
def test_can_build_panel_list(self):
|
||||
# EventPage has no 'panels' definition, so one should be derived from the field list
|
||||
panels = extract_panel_definitions_from_model_class(EventPage)
|
||||
|
|
|
|||
Loading…
Reference in a new issue