diff roundup/cgi/templating.py @ 5876:716d50585c8d

Fix Link/Multilink searching .. for the case that a key property may contain numeric values. This already was correct for menu (in an item template) but was doing the wrong thing for index templates.
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 02 Sep 2019 16:11:17 +0200
parents 883c9e90b403
children c3728772c594
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Wed Aug 28 17:25:59 2019 +0200
+++ b/roundup/cgi/templating.py	Mon Sep 02 16:11:17 2019 +0200
@@ -384,6 +384,10 @@
     cl = db.getclass(prop.classname)
     l = []
     for entry in ids:
+        # Do not look up numeric IDs
+        if num_re.match(entry):
+            l.append(entry)
+            continue
         if do_lookup:
             try:
                 item = cl.lookup(entry)
@@ -394,7 +398,7 @@
                 continue
         # if fail_ok, ignore lookup error
         # otherwise entry must be existing object id rather than key value
-        if fail_ok or num_re.match(entry):
+        if fail_ok:
             l.append(entry)
     return l
 

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