Remove the possibility to select default non-analog poll types, if electronic voting is disabled
This commit is contained in:
parent
26e414e3d1
commit
07a003717d
@ -232,7 +232,7 @@ export abstract class PollService {
|
|||||||
onehundred_percent_base: this.defaultPercentBase,
|
onehundred_percent_base: this.defaultPercentBase,
|
||||||
majority_method: this.defaultMajorityMethod,
|
majority_method: this.defaultMajorityMethod,
|
||||||
groups_id: this.defaultGroupIds,
|
groups_id: this.defaultGroupIds,
|
||||||
type: this.defaultPollType
|
type: this.isElectronicVotingEnabled ? this.defaultPollType : PollType.Analog
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from django.conf import settings
|
||||||
from django.core.validators import MinValueValidator
|
from django.core.validators import MinValueValidator
|
||||||
|
|
||||||
from openslides.assignments.models import AssignmentPoll
|
from openslides.assignments.models import AssignmentPoll
|
||||||
@ -25,14 +26,24 @@ def get_config_variables():
|
|||||||
subgroup="Ballot",
|
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(
|
yield ConfigVariable(
|
||||||
name="assignment_poll_default_type",
|
name="assignment_poll_default_type",
|
||||||
default_value=AssignmentPoll.TYPE_ANALOG,
|
default_value=AssignmentPoll.TYPE_ANALOG,
|
||||||
input_type="choice",
|
input_type="choice",
|
||||||
label="Default voting type",
|
label="Default voting type",
|
||||||
choices=tuple(
|
choices=assignment_poll_type_choices,
|
||||||
{"value": type[0], "display_name": type[1]} for type in AssignmentPoll.TYPES
|
|
||||||
),
|
|
||||||
weight=403,
|
weight=403,
|
||||||
group="Elections",
|
group="Elections",
|
||||||
subgroup="Ballot",
|
subgroup="Ballot",
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from django.conf import settings
|
||||||
from django.core.validators import MinValueValidator
|
from django.core.validators import MinValueValidator
|
||||||
|
|
||||||
from openslides.core.config import ConfigVariable
|
from openslides.core.config import ConfigVariable
|
||||||
@ -341,14 +342,21 @@ def get_config_variables():
|
|||||||
|
|
||||||
# Voting and ballot papers
|
# 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(
|
yield ConfigVariable(
|
||||||
name="motion_poll_default_type",
|
name="motion_poll_default_type",
|
||||||
default_value=MotionPoll.TYPE_ANALOG,
|
default_value=MotionPoll.TYPE_ANALOG,
|
||||||
input_type="choice",
|
input_type="choice",
|
||||||
label="Default voting type",
|
label="Default voting type",
|
||||||
choices=tuple(
|
choices=motion_poll_type_choices,
|
||||||
{"value": type[0], "display_name": type[1]} for type in MotionPoll.TYPES
|
|
||||||
),
|
|
||||||
weight=367,
|
weight=367,
|
||||||
group="Motions",
|
group="Motions",
|
||||||
subgroup="Voting and ballot papers",
|
subgroup="Voting and ballot papers",
|
||||||
|
Loading…
Reference in New Issue
Block a user