diff --git a/district/blocks.py b/district/blocks.py index 6e92b9297c2b63d503a5ec5dd8374636cb016855..ba2573410511ef714fa6bc352e6c247dec060eca 100644 --- a/district/blocks.py +++ b/district/blocks.py @@ -153,6 +153,8 @@ class OctopusMixin(blocks.StructBlock): originating_groups__name=value["group_shortcut"] ) .order_by("person__order", "title") + # Hacky, but should work all of the time with our current members. + .distinct("person__order", "title") .all() ) @@ -217,6 +219,8 @@ class OctopusTeamBlock(OctopusMixin): context["person_list"] = ( DistrictOctopusPersonPage.objects.filter(filter) .order_by("person__order", "title") + # Hacky, but should work all of the time with our current members. + .distinct("person__order", "title") .all() ) diff --git a/district/templatetags/district_people_filters.py b/district/templatetags/district_people_filters.py index 11a8dad41052f3594d63597d861e4d3cc9f97a76..ec9d33ee800a4b9378b3b55d47ac86f32e00239f 100644 --- a/district/templatetags/district_people_filters.py +++ b/district/templatetags/district_people_filters.py @@ -24,7 +24,8 @@ def get_block_octopus_person_list(block): return ( DistrictOctopusPersonPage.objects.filter(filter) .order_by("person__order", "title") - .distinct() + # Hacky, but should work all of the time with our current members. + .distinct("person__order", "title") .live() .all() )