From 276f76d320c0dab9e676abcc74849047a6a10afe Mon Sep 17 00:00:00 2001 From: Stefan Frauenknecht Date: Fri, 10 Oct 2014 21:30:22 +0200 Subject: [PATCH] Omit leading zero in method item_no if no agenda prefix is given. --- openslides/agenda/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 459b50547..50414209a 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -304,10 +304,12 @@ class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel): @property def item_no(self): + item_no = None if self.item_number: - item_no = '%s %s' % (config['agenda_number_prefix'], self.item_number) - else: - item_no = None + if config['agenda_number_prefix']: + item_no = '%s %s' % (config['agenda_number_prefix'], self.item_number) + else: + item_no = str(self.item_number) return item_no def calc_item_no(self):