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`.
pull/3101/merge
Jaap Roes 2016-10-25 09:46:33 +02:00 zatwierdzone przez Matt Westcott
rodzic 992b315be6
commit fb06f6c0c1
2 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -174,6 +174,7 @@ Contributors
* Axel Haustant
* Henk-Jan van Hasselaar
* alexfromvl
* Jaap Roes
Translators
===========

Wyświetl plik

@ -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: