diff --git a/openslides/assignments/config_variables.py b/openslides/assignments/config_variables.py index 92afaeb8f..48938cb5a 100644 --- a/openslides/assignments/config_variables.py +++ b/openslides/assignments/config_variables.py @@ -55,6 +55,15 @@ def get_config_variables(): group='Elections', subgroup='Ballot and ballot papers') + yield ConfigVariable( + name='assignments_add_candidates_to_list_of_speakers', + default_value=True, + input_type='boolean', + label='Put all candidates on the list of speakers', + weight=428, + group='Elections', + subgroup='Ballot and ballot papers') + yield ConfigVariable( name='assignments_pdf_ballot_papers_selection', default_value='CUSTOM_NUMBER', diff --git a/openslides/assignments/models.py b/openslides/assignments/models.py index 3c5ea7396..a5494e13b 100644 --- a/openslides/assignments/models.py +++ b/openslides/assignments/models.py @@ -285,14 +285,15 @@ class Assignment(RESTModelMixin, models.Model): # Add all candidates to list of speakers of related agenda item # TODO: Try to do this in a bulk create - for candidate in self.candidates: - try: - Speaker.objects.add(candidate, self.agenda_item, skip_autoupdate=True) - except OpenSlidesError: - # The Speaker is already on the list. Do nothing. - # TODO: Find a smart way not to catch the error concerning AnonymousUser. - pass - inform_changed_data(self.agenda_item) + if config['assignments_add_candidates_to_list_of_speakers']: + for candidate in self.candidates: + try: + Speaker.objects.add(candidate, self.agenda_item, skip_autoupdate=True) + except OpenSlidesError: + # The Speaker is already on the list. Do nothing. + # TODO: Find a smart way not to catch the error concerning AnonymousUser. + pass + inform_changed_data(self.agenda_item) return poll diff --git a/openslides/assignments/static/js/assignments/base.js b/openslides/assignments/static/js/assignments/base.js index d5bab1872..f7b46826a 100644 --- a/openslides/assignments/static/js/assignments/base.js +++ b/openslides/assignments/static/js/assignments/base.js @@ -72,7 +72,9 @@ angular.module('OpenSlidesApp.assignments', []) if (base && !skipPercents) { percentNumber = Math.round(vote.weight * 100 / base * 100) / 100; - percentStr = "(" + percentNumber + "%)"; + if (percentNumber >= 0) { + percentStr = '(' + percentNumber + ' %)'; + } } votes.push({ 'order': order, diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index c8ce443a6..94aa3a815 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -875,6 +875,7 @@ angular.module('OpenSlidesApp.assignments.site', [ gettext('Two-thirds majority'); gettext('Three-quarters majority'); gettext('Disabled'); + gettext('Put all candidates on the list of speakers'); gettext('Title for PDF document (all elections)'); gettext('Preamble text for PDF document (all elections)'); //other translations