From c5bd710d37ce4d15f4c7c55a08fb407b37061653 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 12 Apr 2017 00:10:00 +0200 Subject: [PATCH] Constrain page parent types --- publichealth/home/models/forms.py | 1 + publichealth/home/models/models.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/publichealth/home/models/forms.py b/publichealth/home/models/forms.py index b525d76..f4c1f09 100644 --- a/publichealth/home/models/forms.py +++ b/publichealth/home/models/forms.py @@ -55,5 +55,6 @@ class ContactForm(AbstractEmailForm): ], "Email"), ] + parent_page_types = ['home.ArticleIndexPage'] class Meta: verbose_name = "Formular" diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py index dd3b533..16fc544 100644 --- a/publichealth/home/models/models.py +++ b/publichealth/home/models/models.py @@ -43,7 +43,7 @@ class ArticleIndexPage(Page): context['articles'] = articles return context - subpage_types = ['home.ArticlePage', 'home.ArticleIndexPage'] + subpage_types = ['home.ArticlePage', 'home.ArticleIndexPage', 'home.ContactForm'] class Meta: verbose_name = "Rubrik" @@ -118,7 +118,7 @@ class ArticlePage(Page): ], heading="Veröffentlichung"), MultiFieldPanel(Page.promote_panels, "Einstellungen"), ] - parent_page_types = ['home.ArticleIndexPage'] + subpage_types = [] class Meta: verbose_name = "Artikel"