From 4ed1557b55c77859b4097bb1baba18690bc426a2 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 14 Dec 2023 15:27:41 +0000 Subject: [PATCH] update area view to only select current MPs makes no difference at the moment as all MPs are current. --- hub/views/area.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hub/views/area.py b/hub/views/area.py index 71c6671da..ea0b6f1d4 100644 --- a/hub/views/area.py +++ b/hub/views/area.py @@ -202,7 +202,9 @@ def get_context_data(self, **kwargs): context["area_type"] = str(self.object.area_type) try: context["mp"] = { - "person": Person.objects.get(area=self.object, person_type="MP") + "person": Person.objects.get( + area=self.object, person_type="MP", end_date__isnull=True + ) } data = PersonData.objects.filter(