From a0842c0e77636b08e894436c0035c021a8880fe3 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Wed, 17 Jan 2018 16:14:20 +0000
Subject: [PATCH] Move the content panels onto the Mixin class and reference
 correctly.

---
 opentech/public/people/models.py   | 3 +--
 opentech/public/projects/models.py | 3 +--
 opentech/public/utils/models.py    | 4 +++-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opentech/public/people/models.py b/opentech/public/people/models.py
index b6ca87aa2..98a7560b1 100644
--- a/opentech/public/people/models.py
+++ b/opentech/public/people/models.py
@@ -149,8 +149,7 @@ class PersonPage(FundingMixin, BasePage):
         InlinePanel('person_types', label='Person types'),
         FieldPanel('introduction'),
         StreamFieldPanel('biography'),
-        InlinePanel('funding', label='Funding'),
-    ]
+    ] + FundingMixin.content_panels
 
 
 class PersonIndexPage(BasePage):
diff --git a/opentech/public/projects/models.py b/opentech/public/projects/models.py
index 5ace6d9db..91f65f364 100644
--- a/opentech/public/projects/models.py
+++ b/opentech/public/projects/models.py
@@ -116,8 +116,7 @@ class ProjectPage(FundingMixin, BasePage):
         StreamFieldPanel('body'),
         InlinePanel('contact_details', label="Contact Details"),
         InlinePanel('related_pages', label="Related Projects"),
-        InlinePanel('funding', label="Funding"),
-    ]
+    ] + FundingMixin.content_panels
 
 
 class ProjectIndexPage(BasePage):
diff --git a/opentech/public/utils/models.py b/opentech/public/utils/models.py
index 3b45d94d1..b4505bea9 100644
--- a/opentech/public/utils/models.py
+++ b/opentech/public/utils/models.py
@@ -4,6 +4,7 @@ from django.db import models
 from wagtail.wagtailadmin.edit_handlers import (
     FieldPanel,
     FieldRowPanel,
+    InlinePanel,
     MultiFieldPanel,
     PageChooserPanel,
     StreamFieldPanel,
@@ -287,8 +288,9 @@ class BaseFunding(Orderable):
 class FundingMixin(models.Model):
     '''Implements the funding total calculation
 
-    You still need to include the InlinePanel('funding') in the child class
+    You still need to include the content panel in the child class
     '''
+    content_panels = [InlinePanel('funding', label="Funding")]
 
     class Meta:
         abstract = True
-- 
GitLab