diff --git a/district/forms.py b/district/forms.py index 3579fd46884995322f73b2ed0ff9d762e4abb256..beb5f055332469c9a087f6acd2a36061fe38a00d 100644 --- a/district/forms.py +++ b/district/forms.py @@ -44,11 +44,12 @@ class DistrictPeoplePageForm(WagtailAdminPageForm): if collection_id is None: collection_id = Collection.objects.first().id - for shortcut in self.instance.get_syncable_octopus_groups(): + for group in self.instance.get_syncable_octopus_groups(): import_people_from_group.delay( self.instance.id, collection_id, - shortcut, + group["shortcut"], + group["title"], ) return super().save(*args, **kwargs) diff --git a/district/models.py b/district/models.py index 9c393dfa6c361e006ebe25cefd2be23a26f606c3..3afe74879c19c4155e2ce6d946e421c35cf13602 100644 --- a/district/models.py +++ b/district/models.py @@ -778,6 +778,9 @@ class DistrictPeoplePage(MainPeoplePageMixin): # with them around, convert roles to lists only after we know the teams # are unique. for position, team in enumerate(unique_teams): + if team["roles"] is None: + continue + unique_teams[position]["roles"] = team["roles"].split(",") return unique_teams