diff --git a/backend/hub/templates/hub/candidate/list.html b/backend/hub/templates/hub/candidate/list.html index 55f9cd1b..7279def6 100644 --- a/backend/hub/templates/hub/candidate/list.html +++ b/backend/hub/templates/hub/candidate/list.html @@ -60,7 +60,6 @@

{% if page_obj %} - {% cache listing_cache_duration "candidate_listing" %}
{% if not SINGLE_DOMAIN_ROUND %} @@ -69,7 +68,6 @@

{% include "hub/candidate/components/listing_detail.html" %} {% endif %}

- {% endcache %} {% endif %}
diff --git a/backend/hub/views.py b/backend/hub/views.py index 6a857114..7dcbd51d 100644 --- a/backend/hub/views.py +++ b/backend/hub/views.py @@ -534,17 +534,25 @@ class CandidateListView(SearchMixin): @classmethod def get_candidates_to_vote(cls): - return Candidate.objects_with_org.filter( - org__status=Organization.STATUS.accepted, - status=Candidate.STATUS.confirmed, - is_proposed=True, + return ( + Candidate.objects_with_org.filter( + org__status=Organization.STATUS.accepted, + status=Candidate.STATUS.confirmed, + is_proposed=True, + ) + .select_related("org") + .prefetch_related("domain") ) @classmethod def get_candidates_pending(cls): - return Candidate.objects_with_org.filter( - org__status=Organization.STATUS.accepted, - is_proposed=True, + return ( + Candidate.objects_with_org.filter( + org__status=Organization.STATUS.accepted, + is_proposed=True, + ) + .select_related("org") + .prefetch_related("domain") ) def get_qs(self):