From d638d5b7e265a3052c4a2f1580f4080ab2323c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Sun, 4 May 2014 13:41:55 +0200 Subject: [PATCH] Fixed bug of numbering view when there are orga items. Renamed toRoman to to_roman. --- openslides/agenda/models.py | 6 ++++-- openslides/utils/utils.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 088afed44..a8bfb6b94 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -20,7 +20,7 @@ from openslides.projector.models import SlideMixin from openslides.utils.exceptions import OpenSlidesError from openslides.utils.models import AbsoluteUrlMixin from openslides.utils.person.models import PersonField -from openslides.utils.utils import toRoman +from openslides.utils.utils import to_roman class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel): @@ -319,9 +319,11 @@ class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel): if config['agenda_numeral_system'] == 'arabic': return str(self._calc_sibling_no()) else: # config['agenda_numeral_system'] == 'roman' - return toRoman(self._calc_sibling_no()) + return to_roman(self._calc_sibling_no()) else: return '%s.%s' % (self.parent.calc_item_no(), self._calc_sibling_no()) + else: + return '' def _calc_sibling_no(self): """ diff --git a/openslides/utils/utils.py b/openslides/utils/utils.py index 66f8044bc..d509c7a41 100644 --- a/openslides/utils/utils.py +++ b/openslides/utils/utils.py @@ -74,7 +74,7 @@ def int_or_none(var): return None -def toRoman(number): +def to_roman(number): """ Converts an arabic number within range from 1 to 4999 to the corresponding roman number. Returns None on error conditions.