From fb06f6c0c19182470b285aa1817f0afb211ecbac Mon Sep 17 00:00:00 2001 From: Jaap Roes Date: Tue, 25 Oct 2016 09:46:33 +0200 Subject: [PATCH] Fixed #3078 -- Add empty panel attributes Accessing any of these attributes before importing `wagtailadmin.edit_handlers` would raise a `AttributeError`. In some cases this would mask the actual error; e.g. forgetting to import `wagtailadmin.edit_handlers`. --- CONTRIBUTORS.rst | 1 + wagtail/wagtailcore/models.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 3e51b81742..83cae3d20d 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -174,6 +174,7 @@ Contributors * Axel Haustant * Henk-Jan van Hasselaar * alexfromvl +* Jaap Roes Translators =========== diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index 04de4e75c2..e633eeef2f 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -396,6 +396,12 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable # Do not allow plain Page instances to be created through the Wagtail admin is_creatable = False + # Define these attributes early to avoid masking errors. (Issue #3078) + # The canonical definition is in wagtailadmin.edit_handlers. + content_panels = [] + promote_panels = [] + settings_panels = [] + def __init__(self, *args, **kwargs): super(Page, self).__init__(*args, **kwargs) if not self.id and not self.content_type_id: