Skip to content

Commit 49b1da7

Browse files
author
Ralf Schlatterbeck
committed
Update on recent fix, better version suggested by alexander smishlajev
1 parent 08a2b3d commit 49b1da7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

roundup/cgi/templating.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,14 @@ def lookupIds(db, prop, ids, fail_ok=0, num_re=num_re, do_lookup=True):
373373
cl = db.getclass(prop.classname)
374374
l = []
375375
for entry in ids:
376-
try:
377-
if do_lookup:
378-
l.append(cl.lookup(entry))
376+
if do_lookup:
377+
try:
378+
item = cl.lookup(entry)
379+
except (TypeError, KeyError):
380+
pass
381+
else:
382+
l.append(item)
379383
continue
380-
except (TypeError, KeyError):
381-
pass
382384
# if fail_ok, ignore lookup error
383385
# otherwise entry must be existing object id rather than key value
384386
if fail_ok or num_re.match(entry):

0 commit comments

Comments
 (0)