Merge pull request #2818 from emanuelschuetze/motion-identifier-without-blanks

Add new personal settings MOTION_IDENTIFIER_WITHOUT_BLANKS.
This commit is contained in:
Norman Jäckel 2017-01-08 13:43:20 +01:00 committed by GitHub
commit 1a88f0985a
3 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,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