Skip to content

Commit 0780938

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 58f01f4 commit 0780938

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Fixed:
66
- existing trackers (ie. live ones) may be used as templates for new
77
trackers - the TEMPLATE-INFO.txt name entry has the tracker's dir name
88
appended (so the demo tracker's template name is "classic-demo")
9+
- handle bad multilink input at item creation time better (sf bug 917834)
910

1011

1112
2004-03-01 0.6.7

roundup/cgi/templating.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,18 @@ def lookupIds(db, prop, ids, fail_ok=0, num_re=re.compile('-?\d+')):
265265
l.append(entry)
266266
return l
267267

268+
def lookupKeys(cl, key, ids, num_re=re.compile('-?\d+')):
269+
''' Look up the "key" values for "ids" list - though some may already
270+
be key values, not ids.
271+
'''
272+
l = []
273+
for entry in ids:
274+
if num_re.match(entry):
275+
l.append(cl.get(entry, key))
276+
else:
277+
l.append(entry)
278+
return l
279+
268280
class HTMLPermissions:
269281
''' Helpers that provide answers to commonly asked Permission questions.
270282
'''
@@ -1321,7 +1333,7 @@ def field(self, size=30, showid=0):
13211333
showid=1
13221334
if not showid:
13231335
k = linkcl.labelprop(1)
1324-
value = [linkcl.get(v, k) for v in value]
1336+
value = lookupKeys(linkcl, k, value)
13251337
value = cgi.escape(','.join(value))
13261338
return '<input name="%s" size="%s" value="%s">'%(self._formname, size, value)
13271339

0 commit comments

Comments
 (0)