diff roundup/cgi/templating.py @ 6398:26e5c42f148c

issue2551078 - Fix traceback caused when putting two id's into a Link html field. A ValueError is raised. Handle exception and return invalid value. hyperdb.py now reports 'you may only enter ID values for property ...' to the user.
author John Rouillard <rouilj@ieee.org>
date Fri, 07 May 2021 22:26:37 -0400
parents a7e7314fb7d9
children e29d5f4e0af4
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Fri May 07 21:47:16 2021 +0200
+++ b/roundup/cgi/templating.py	Fri May 07 22:26:37 2021 -0400
@@ -1058,8 +1058,11 @@
 
         # get the value, handling missing values
         value = None
-        if int(self._nodeid) > 0:
-            value = self._klass.get(self._nodeid, items[0], None)
+        try:
+            if int(self._nodeid) > 0:
+                value = self._klass.get(self._nodeid, items[0], None)
+        except ValueError:
+            value = self._nodeid
         if value is None:
             if isinstance(prop, hyperdb.Multilink):
                 value = []

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