-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a voting domain to organizations
- add a voting_domain property to organizations - connect it to a candidate's domain - add a feature flag for enabling the voting_domain
- Loading branch information
1 parent
bce807e
commit ae8d572
Showing
8 changed files
with
462 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
backend/hub/migrations/0066_organization_voting_domain_alter_candidate_domain_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Generated by Django 4.2.15 on 2024-09-13 13:32 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hub", "0065_candidate_photo"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="organization", | ||
name="voting_domain", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="The domain in which the organization can vote, support, and propose candidates – once set, the field can only be modified by the platform's administrators.", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="organizations", | ||
to="hub.domain", | ||
verbose_name="Voting domain", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="candidate", | ||
name="domain", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="The domain in which the candidate is running.", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="candidates", | ||
to="hub.domain", | ||
verbose_name="Domain", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="featureflag", | ||
name="flag", | ||
field=models.CharField( | ||
choices=[ | ||
("enable_org_registration", "Enable organization registration"), | ||
("enable_org_approval", "Enable organization approvals"), | ||
("enable_candidate_registration", "Enable candidate registration"), | ||
("enable_candidate_supporting", "Enable candidate supporting"), | ||
("enable_candidate_voting", "Enable candidate voting"), | ||
("enable_candidate_confirmation", "Enable candidate confirmation"), | ||
("enable_results_display", "Enable the display of results"), | ||
("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", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="organization", | ||
name="status", | ||
field=models.CharField( | ||
choices=[ | ||
("draft", "Draft"), | ||
("pending", "Pending approval"), | ||
("ngohub_accepted", "NGO Hub accepted"), | ||
("accepted", "Accepted"), | ||
("rejected", "Rejected"), | ||
], | ||
db_index=True, | ||
default="draft", | ||
max_length=30, | ||
verbose_name="Status", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.