diff --git a/client/src/app/site/polls/services/poll.service.ts b/client/src/app/site/polls/services/poll.service.ts index ea31691bd..077a8bcdf 100644 --- a/client/src/app/site/polls/services/poll.service.ts +++ b/client/src/app/site/polls/services/poll.service.ts @@ -232,7 +232,7 @@ export abstract class PollService { onehundred_percent_base: this.defaultPercentBase, majority_method: this.defaultMajorityMethod, groups_id: this.defaultGroupIds, - type: this.defaultPollType + type: this.isElectronicVotingEnabled ? this.defaultPollType : PollType.Analog }; } diff --git a/server/openslides/assignments/config_variables.py b/server/openslides/assignments/config_variables.py index 87985bb7f..97a4e188d 100644 --- a/server/openslides/assignments/config_variables.py +++ b/server/openslides/assignments/config_variables.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.core.validators import MinValueValidator from openslides.assignments.models import AssignmentPoll @@ -25,14 +26,24 @@ def get_config_variables(): subgroup="Ballot", ) + if getattr(settings, "ENABLE_ELECTRONIC_VOTING", False): + assignment_poll_type_choices = tuple( + {"value": type[0], "display_name": type[1]} for type in AssignmentPoll.TYPES + ) + else: + assignment_poll_type_choices = ( + { + "value": AssignmentPoll.TYPE_ANALOG, + "display_name": AssignmentPoll.TYPE_ANALOG, + }, + ) + yield ConfigVariable( name="assignment_poll_default_type", default_value=AssignmentPoll.TYPE_ANALOG, input_type="choice", label="Default voting type", - choices=tuple( - {"value": type[0], "display_name": type[1]} for type in AssignmentPoll.TYPES - ), + choices=assignment_poll_type_choices, weight=403, group="Elections", subgroup="Ballot", diff --git a/server/openslides/motions/config_variables.py b/server/openslides/motions/config_variables.py index 13524e5f2..76999af09 100644 --- a/server/openslides/motions/config_variables.py +++ b/server/openslides/motions/config_variables.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.core.validators import MinValueValidator from openslides.core.config import ConfigVariable @@ -341,14 +342,21 @@ def get_config_variables(): # Voting and ballot papers + if getattr(settings, "ENABLE_ELECTRONIC_VOTING", False): + motion_poll_type_choices = tuple( + {"value": type[0], "display_name": type[1]} for type in MotionPoll.TYPES + ) + else: + motion_poll_type_choices = ( + {"value": MotionPoll.TYPE_ANALOG, "display_name": MotionPoll.TYPE_ANALOG}, + ) + yield ConfigVariable( name="motion_poll_default_type", default_value=MotionPoll.TYPE_ANALOG, input_type="choice", label="Default voting type", - choices=tuple( - {"value": type[0], "display_name": type[1]} for type in MotionPoll.TYPES - ), + choices=motion_poll_type_choices, weight=367, group="Motions", subgroup="Voting and ballot papers",