From 7ad5798a3fe33192b4942e3c519ae47ffba2df19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org> Date: Fri, 29 Nov 2024 17:22:12 +0100 Subject: [PATCH] distinctify people --- district/blocks.py | 4 ++++ district/templatetags/district_people_filters.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/district/blocks.py b/district/blocks.py index 6e92b929..ba257341 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 11a8dad4..ec9d33ee 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() ) -- GitLab