From d712a879841dba8a6b18d14342e5ae1af5686051 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 13 Jan 2003 03:26:28 +0000 Subject: [PATCH] fixed history display code for 2.1 compatibility git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1445 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/templating.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 1d8779c..7099846 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -517,12 +517,12 @@ class HTMLItem(HTMLPermissions): history.sort() if direction == 'descending': history.reverse() - for prop_n in self._props: + for prop_n in self._props.keys(): prop = self[prop_n] if isinstance(prop, HTMLProperty): current[prop_n] = prop.plain() # make link if hrefable - if prop_n in self._props and isinstance(self._props[prop_n], hyperdb.Link): + if isinstance(self._props[prop_n], hyperdb.Link): classname = self._props[prop_n].classname if os.path.exists(os.path.join(self._db.config.TEMPLATES, classname + '.item')): current[prop_n] = '%s'%(classname, @@ -626,40 +626,40 @@ class HTMLItem(HTMLPermissions): else: old = label; cell.append('%s: %s' % (k,old)) - if k in current: + if current.has_key(k): cell[-1] += ' -> %s'%current[k] current[k] = old elif isinstance(prop, hyperdb.Date) and args[k]: d = date.Date(args[k]) cell.append('%s: %s'%(k, str(d))) - if k in current: + if current.has_key(k): cell[-1] += ' -> %s'%current[k] current[k] = str(d) elif isinstance(prop, hyperdb.Interval) and args[k]: d = date.Interval(args[k]) cell.append('%s: %s'%(k, str(d))) - if k in current: + if current.has_key(k): cell[-1] += ' -> %s'%current[k] current[k] = str(d) elif isinstance(prop, hyperdb.String) and args[k]: cell.append('%s: %s'%(k, cgi.escape(args[k]))) - if k in current: + if current.has_key(k): cell[-1] += ' -> %s'%current[k] current[k] = cgi.escape(args[k]) elif not args[k]: - if k not in current: - cell.append('%s: (no value)'%k) - else: + if current.has_key(k): cell.append('%s: %s'%(k, current[k])) current[k] = '(no value)' + else: + cell.append('%s: (no value)'%k) else: cell.append('%s: %s'%(k, str(args[k]))) - if k in current: + if current.has_key(k): cell[-1] += ' -> %s'%current[k] current[k] = str(args[k]) else: -- 2.39.5