From e8d6dd6c8746b850a5f050af1365cf92c53f5877 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 14 Dec 2023 15:21:40 +0000 Subject: [PATCH] use person type when looking up MP --- 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 2953b0ec6..71c6671da 100644 --- a/hub/views/area.py +++ b/hub/views/area.py @@ -201,7 +201,9 @@ def get_context_data(self, **kwargs): context["overlap_constituencies"] = self.get_overlap_info() context["area_type"] = str(self.object.area_type) try: - context["mp"] = {"person": Person.objects.get(area=self.object)} + context["mp"] = { + "person": Person.objects.get(area=self.object, person_type="MP") + } data = PersonData.objects.filter( person=context["mp"]["person"]