changeset 5051:b69c5e763295

issue2550748: Crash when creating new issues with non-existing multilink values (in classic template). Applied patch provided by user. (John Rouillard)
author John Rouillard <rouilj@ieee.org>
date Sat, 09 Apr 2016 01:15:22 -0400
parents 1571a902a030
children 737d3edee3ab 9792b18e0b19
files CHANGES.txt roundup/cgi/templating.py
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Sat Apr 09 00:33:10 2016 -0400
+++ b/CHANGES.txt	Sat Apr 09 01:15:22 2016 -0400
@@ -31,6 +31,9 @@
 - issue2550601: gsoc-2009 "bug" class doesn't have "patches" property
   Added multilink to patches to the bug schema in the devel template.
   (John Rouillard)
+- issue2550748: Crash when creating new issues with non-existing
+  multilink values (in classic template). Applied patch so it
+  now errors the same way as an update does.  (John Rouillard)
 
 2016-01-11: 1.5.1
 
--- a/roundup/cgi/templating.py	Sat Apr 09 00:33:10 2016 -0400
+++ b/roundup/cgi/templating.py	Sat Apr 09 01:15:22 2016 -0400
@@ -363,7 +363,11 @@
     l = []
     for entry in ids:
         if num_re.match(entry):
-            label = linkcl.get(entry, key)
+            try:
+		label = linkcl.get(entry, key)
+	    except IndexError:
+		# fall back to id if illegal (avoid template crash)
+                label = entry
             # fall back to designator if label is None
             if label is None: label = '%s%s'%(linkcl.classname, entry)
             l.append(label)

Roundup Issue Tracker: http://roundup-tracker.org/