diff --git a/district/management/commands/octopus_people_import.py b/district/management/commands/octopus_people_import.py index 13bd1319dd73e02a585cd74b1435b844fb9b0a9e..100857ddf2ab85f44d633f0e00be82bf1c8db307 100644 --- a/district/management/commands/octopus_people_import.py +++ b/district/management/commands/octopus_people_import.py @@ -15,6 +15,10 @@ class Command(BaseCommand): def handle(self, *args, **options): for people_page in DistrictPeoplePage.objects.all(): for group in people_page.get_syncable_octopus_groups(): + 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: diff --git a/shared/people_import.py b/shared/people_import.py index 03c006977e5ffc4daa63dea308312b47b47e7587..35bb1ab51876d92ed8d6eff31f30d3ba66cdd4fa 100644 --- a/shared/people_import.py +++ b/shared/people_import.py @@ -39,7 +39,7 @@ class ImporterMixin: "email": profile["email"], "phone": profile["phone"], "position": profile.get("position"), - "order": profile.get("order"), + "order": profile.get("order", 0), "facebook_url": profile["facebookUrl"], "flickr_url": profile["flickrUrl"], "instagram_url": profile["instagramUrl"],