diff --git a/backend/hub/admin.py b/backend/hub/admin.py index 610c0ad..b30f9e7 100644 --- a/backend/hub/admin.py +++ b/backend/hub/admin.py @@ -734,6 +734,7 @@ def flags_phase_pause(self, request, __: QuerySet[FeatureFlag]): "enable_candidate_confirmation", "enable_candidate_voting", "enable_results_display", + "enable_pending_results", "enable_final_results_display", ], ) @@ -755,6 +756,7 @@ def flags_phase_deactivate(self, request, __: QuerySet[FeatureFlag]): "enable_candidate_confirmation", "enable_candidate_voting", "enable_results_display", + "enable_pending_results", "enable_final_results_display", ], ) @@ -777,6 +779,7 @@ def flags_phase_1(self, request, __: QuerySet[FeatureFlag]): "enable_candidate_confirmation", "enable_candidate_voting", "enable_results_display", + "enable_pending_results", "enable_final_results_display", ], ) @@ -799,6 +802,7 @@ def flags_phase_2(self, request, __: QuerySet[FeatureFlag]): "enable_candidate_supporting", "enable_candidate_voting", "enable_results_display", + "enable_pending_results", "enable_final_results_display", ], ) @@ -821,6 +825,7 @@ def flags_phase_3(self, request, __: QuerySet[FeatureFlag]): "enable_candidate_supporting", "enable_candidate_confirmation", "enable_results_display", + "enable_pending_results", "enable_final_results_display", ], ) @@ -843,6 +848,7 @@ def flags_final_phase(self, request, __: QuerySet[FeatureFlag]): "enable_candidate_supporting", "enable_candidate_voting", "enable_candidate_confirmation", + "enable_pending_results", "enable_final_results_display", ], ) diff --git a/backend/hub/migrations/0080_alter_featureflag_flag.py b/backend/hub/migrations/0080_alter_featureflag_flag.py new file mode 100644 index 0000000..e25068c --- /dev/null +++ b/backend/hub/migrations/0080_alter_featureflag_flag.py @@ -0,0 +1,41 @@ +# Generated by Django 4.2.16 on 2024-12-03 22:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("hub", "0079_alter_featureflag_flag"), + ] + + operations = [ + migrations.AlterField( + model_name="featureflag", + name="flag", + field=models.CharField( + choices=[ + ("enable_org_registration", "Enable organization registration"), + ("enable_org_editing", "Enable organization editing"), + ("enable_org_approval", "Enable organization approvals"), + ("enable_candidate_registration", "Enable candidate registration"), + ("enable_candidate_editing", "Enable candidate editing"), + ("enable_candidate_supporting", "Enable candidate supporting"), + ("enable_candidate_voting", "Enable candidate voting"), + ("enable_candidate_confirmation", "Enable candidate confirmation"), + ("enable_pending_results", "Enable the phase when waiting for the display of results"), + ("enable_results_display", "Enable the display of results"), + ("enable_final_results_display", "Enable the display of results after resolving all complaints"), + ("single_domain_round", "Voting round with just one domain (some restrictions will apply)"), + ( + "global_support_round", + "Enable global support (the support of at least 10 organizations is required)", + ), + ("enable_voting_domain", "Enable the voting domain restriction for an organization"), + ], + max_length=254, + unique=True, + verbose_name="Flag", + ), + ), + ] diff --git a/backend/hub/models.py b/backend/hub/models.py index a0bc6f4..da7387c 100644 --- a/backend/hub/models.py +++ b/backend/hub/models.py @@ -112,6 +112,7 @@ def select_public_storage(): ("enable_candidate_supporting", _("Enable candidate supporting")), ("enable_candidate_voting", _("Enable candidate voting")), ("enable_candidate_confirmation", _("Enable candidate confirmation")), + ("enable_pending_results", _("Enable the phase when waiting for the display of results")), ("enable_results_display", _("Enable the display of results")), ("enable_final_results_display", _("Enable the display of results after resolving all complaints")), ) diff --git a/backend/hub/views.py b/backend/hub/views.py index 501cf08..498b173 100644 --- a/backend/hub/views.py +++ b/backend/hub/views.py @@ -601,7 +601,9 @@ def get_candidates_pending(cls): ) def get_qs(self): - if FeatureFlag.flag_enabled(PHASE_CHOICES.enable_candidate_voting): + if FeatureFlag.flag_enabled(PHASE_CHOICES.enable_candidate_voting) or FeatureFlag.flag_enabled( + PHASE_CHOICES.enable_pending_results + ): return self.get_candidates_to_vote() if FeatureFlag.flag_enabled(PHASE_CHOICES.enable_results_display):