From 68ed4ba20f8f5d0a0b674ad5b010ec4963a36043 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 19 Feb 2024 14:55:06 +0000 Subject: [PATCH] only match on MPs who are in office on search page --- hub/views/area.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hub/views/area.py b/hub/views/area.py index ff6561901..996bbede2 100644 --- a/hub/views/area.py +++ b/hub/views/area.py @@ -436,7 +436,7 @@ def get_context_data(self, **kwargs): else: for area in areas: try: - area.mp = Person.objects.get(area=area) + area.mp = Person.objects.get(area=area, end_date__isnull=True) except Person.DoesNotExist: pass areas.sort(key=lambda area: area.name)