From 347635261a5474f37fa0047fa961ee7fc3c88fb1 Mon Sep 17 00:00:00 2001 From: Virginia Dooley Date: Fri, 8 Sep 2023 13:33:15 +0100 Subject: [PATCH] Add election results to select_related call on BallotViewSet --- ynr/apps/elections/api/next/api_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ynr/apps/elections/api/next/api_views.py b/ynr/apps/elections/api/next/api_views.py index 6a6b730c8..5e87ccbc9 100644 --- a/ynr/apps/elections/api/next/api_views.py +++ b/ynr/apps/elections/api/next/api_views.py @@ -39,7 +39,7 @@ class BallotViewSet(viewsets.ReadOnlyModelViewSet): lookup_value_regex = r"(?!\.json$)[^/]+" queryset = ( extra_models.Ballot.objects.select_related( - "election", "post", "replaces", "replaced_by" + "election", "post", "replaces", "replaced_by", "resultset" ) .prefetch_related( Prefetch(