From b59929c2421e1560290f46e452c5e5d2652a2785 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org>
Date: Thu, 28 Nov 2024 13:26:46 +0100
Subject: [PATCH] fix image collection id workaround

---
 district/management/commands/octopus_people_import.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/district/management/commands/octopus_people_import.py b/district/management/commands/octopus_people_import.py
index 100857dd..16e331a4 100644
--- a/district/management/commands/octopus_people_import.py
+++ b/district/management/commands/octopus_people_import.py
@@ -33,6 +33,10 @@ class Command(BaseCommand):
 
         for people_page in DistrictPeoplePage.objects.all():
             for team in people_page.get_syncable_octopus_teams():
+                if not hasattr(people_page.root_page, "image_collection_id"):
+                    # FIXME: This should not be UniwebHomePage, but sometimes it is.
+                    continue
+                
                 collection_id = people_page.root_page.image_collection_id
 
                 if collection_id is None:
-- 
GitLab