From acee0abd5d0570a4c77736f05b586377bbb87335 Mon Sep 17 00:00:00 2001 From: stefan Date: Fri, 20 Feb 2009 04:07:04 +0000 Subject: [PATCH] Robustify (Multi)linkHTMLProperty.plain. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4150 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/templating.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 772ad61..b6fef8c 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -1830,7 +1830,10 @@ class LinkHTMLProperty(HTMLProperty): linkcl = self._db.classes[self._prop.classname] k = linkcl.labelprop(1) if num_re.match(self._value): - value = str(linkcl.get(self._value, k)) + try: + value = str(linkcl.get(self._value, k)) + except IndexError: + value = self._value else : value = self._value if escape: @@ -2042,9 +2045,15 @@ class MultilinkHTMLProperty(HTMLProperty): k = linkcl.labelprop(1) labels = [] for v in self._value: - label = linkcl.get(v, k) - # fall back to designator if label is None - if label is None: label = '%s%s'%(self._prop.classname, k) + if num_re.match(v): + try: + label = linkcl.get(v, k) + except IndexError: + label = None + # fall back to designator if label is None + if label is None: label = '%s%s'%(self._prop.classname, k) + else: + label = v labels.append(label) value = ', '.join(labels) if escape: -- 2.30.2