Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 3861:d4ac8954ce5c
Update on recent fix, better version suggested by alexander smishlajev
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Mon, 09 Jul 2007 17:27:04 +0000 |
| parents | c672b15ddae6 |
| children | b052820e86bf |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Thu Jul 05 21:11:28 2007 +0000 +++ b/roundup/cgi/templating.py Mon Jul 09 17:27:04 2007 +0000 @@ -373,12 +373,14 @@ cl = db.getclass(prop.classname) l = [] for entry in ids: - try: - if do_lookup: - l.append(cl.lookup(entry)) + if do_lookup: + try: + item = cl.lookup(entry) + except (TypeError, KeyError): + pass + else: + l.append(item) continue - except (TypeError, KeyError): - pass # 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):
