Skip to content

Commit

Permalink
Merge pull request #2474 from DemocracyClub/completeness-performance
Browse files Browse the repository at this point in the history
Simplify query to candidate completeness view
  • Loading branch information
symroe authored Nov 13, 2024
2 parents 67149e9 + d12a3b5 commit c13a666
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ynr/apps/cached_counts/templates/candidate_completeness.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ <h2>Stats</h2>
<tbody>
{% for membership in qs %}
<tr>
<td><a href="{{ membership.person.get_absolute_url }}">{{ membership.person.name }}</a></td>
<td><a href="{% url "person-view" membership.person_id %}">{{ membership.person_name }}</a></td>
<td>
<a href="{{ membership.ballot_paper.get_absolute_url }}">{{ membership.ballot_paper.ballot_paper_id }}</a>
<a href="{% url "election_view" membership.ballot_paper_id %}">{{ membership.ballot_paper_id }}</a>
</td>
<td>{{ membership.party_name }}</td>
{% for identifier_field in identifier_fields %}
Expand Down
2 changes: 1 addition & 1 deletion ynr/apps/cached_counts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
qs = MaterializedMemberships.objects.filter(
ballot_paper__election__slug=self.election
).select_related("person", "ballot_paper")
)

identifier_fields = sorted(pi.name for pi in PersonIdentifierFields)
annotations = {}
Expand Down

0 comments on commit c13a666

Please sign in to comment.