Add new personal settings MOTION_IDENTIFIER_WITHOUT_BLANKS.

Allow to remove all whitespaces from motion identifier if settings
value is True. Default: False.
Example: "B 1 - Ä 1" -> "B1-Ä1"
This commit is contained in:
Emanuel Schütze 2017-01-06 12:50:29 +01:00
parent f146e11354
commit f4d468a6f6
3 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,7 @@ Motions:
- Changed label of former state "commited a bill" to "refered to committee".
- New csv import layout and using Papa Parse for parsing the csv.
- Number of ballots printed can now be set in config.
- Add new personal settings to remove all whitespaces from motion identifier.
Elections:
- Added options to calculate percentages on different bases.

View File

@ -336,6 +336,10 @@ class Motion(RESTModelMixin, models.Model):
number += 1
identifier = '%s%s' % (prefix, self.extend_identifier_number(number))
# remove all whitespaces from identifier if MOTION_IDENTIFIER_WITHOUT_BLANKS is set
if hasattr(settings, 'MOTION_IDENTIFIER_WITHOUT_BLANKS') and settings.MOTION_IDENTIFIER_WITHOUT_BLANKS:
identifier = identifier.replace(' ', '')
self.identifier = identifier
self.identifier_number = number

View File

@ -120,3 +120,4 @@ SEARCH_INDEX = os.path.join(OPENSLIDES_USER_DATA_PATH, 'search_index')
# Customization of OpenSlides apps
MOTION_IDENTIFIER_MIN_DIGITS = 1
MOTION_IDENTIFIER_WITHOUT_BLANKS = False