From bc7e03dadd03f6c1f20b55719f2b0420f8969b97 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Mon, 4 Nov 2024 15:43:24 -0300 Subject: [PATCH] feat(vote): add elected filter like default in candidature search --- app/org_eleicoes/votepeloclima/candidature/forms/filters.py | 2 +- app/org_eleicoes/votepeloclima/candidature/views/filters.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/org_eleicoes/votepeloclima/candidature/forms/filters.py b/app/org_eleicoes/votepeloclima/candidature/forms/filters.py index c29539f1..a635f2e5 100644 --- a/app/org_eleicoes/votepeloclima/candidature/forms/filters.py +++ b/app/org_eleicoes/votepeloclima/candidature/forms/filters.py @@ -76,7 +76,7 @@ class FilterFormSidebar(RemoveRequiredMixin, forms.ModelForm): ("elected", "Candidaturas eleitas") ], widget=ButtonRadioSelect, - initial="second_round" # Define o filtro de 2º turno como padrão + initial="elected" # Define o filtro de eleito como padrão ) proposes = forms.MultipleChoiceField( label="Propostas", widget=ButtonCheckboxSelectMultiple diff --git a/app/org_eleicoes/votepeloclima/candidature/views/filters.py b/app/org_eleicoes/votepeloclima/candidature/views/filters.py index a3c043d4..7e95a706 100644 --- a/app/org_eleicoes/votepeloclima/candidature/views/filters.py +++ b/app/org_eleicoes/votepeloclima/candidature/views/filters.py @@ -78,9 +78,9 @@ def get_queryset(self): ) ) - election_status = cleaned_data.get("election_status", "second_round") + election_status = cleaned_data.get("election_status", "elected") else: - election_status = "second_round" + election_status = "elected" # Filtra com base no status da eleição if election_status == "second_round":