From f0bc3db987a4dff4c573a9cc5fbe78bb11177e8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org>
Date: Fri, 4 Oct 2024 00:45:27 +0200
Subject: [PATCH] remove octopus page from possible child pages

---
 district/models.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/district/models.py b/district/models.py
index f04cff97..f0d1b70a 100644
--- a/district/models.py
+++ b/district/models.py
@@ -668,6 +668,12 @@ class DistrictPeoplePage(MainPeoplePageMixin):
 
     ### OTHERS
 
+    @classmethod
+    def allowed_subpage_models(cls):
+        # Get all page types and remove the unwanted child page type
+        allowed_pages = super().allowed_subpage_models()
+        return [page for page in allowed_pages if page.__name__ != 'DistrictOctopusPersonPage']
+
     def get_syncable_octopus_groups(self):
         groups = []
 
-- 
GitLab