Skip to content

Commit d9dd275

Browse files
committed
issue2550748: Crash when creating new issues with non-existing multilink values (in classic template). Applied patch provided by user. (John Rouillard)
1 parent 84c5c2a commit d9dd275

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Fixed:
3131
- issue2550601: gsoc-2009 "bug" class doesn't have "patches" property
3232
Added multilink to patches to the bug schema in the devel template.
3333
(John Rouillard)
34+
- issue2550748: Crash when creating new issues with non-existing
35+
multilink values (in classic template). Applied patch so it
36+
now errors the same way as an update does. (John Rouillard)
3437

3538
2016-01-11: 1.5.1
3639

roundup/cgi/templating.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,11 @@ def lookupKeys(linkcl, key, ids, num_re=num_re):
363363
l = []
364364
for entry in ids:
365365
if num_re.match(entry):
366-
label = linkcl.get(entry, key)
366+
try:
367+
label = linkcl.get(entry, key)
368+
except IndexError:
369+
# fall back to id if illegal (avoid template crash)
370+
label = entry
367371
# fall back to designator if label is None
368372
if label is None: label = '%s%s'%(linkcl.classname, entry)
369373
l.append(label)

0 commit comments

Comments
 (0)