Skip to content

Commit 8e4fa72

Browse files
author
Richard Jones
committed
fixed history display code for 2.1 compatibility
1 parent b81f54f commit 8e4fa72

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

roundup/cgi/templating.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,12 @@ def history(self, direction='descending', dre=re.compile('\d+')):
517517
history.sort()
518518
if direction == 'descending':
519519
history.reverse()
520-
for prop_n in self._props:
520+
for prop_n in self._props.keys():
521521
prop = self[prop_n]
522522
if isinstance(prop, HTMLProperty):
523523
current[prop_n] = prop.plain()
524524
# make link if hrefable
525-
if prop_n in self._props and isinstance(self._props[prop_n], hyperdb.Link):
525+
if isinstance(self._props[prop_n], hyperdb.Link):
526526
classname = self._props[prop_n].classname
527527
if os.path.exists(os.path.join(self._db.config.TEMPLATES, classname + '.item')):
528528
current[prop_n] = '<a href="%s%s">%s</a>'%(classname,
@@ -626,40 +626,40 @@ def history(self, direction='descending', dre=re.compile('\d+')):
626626
else:
627627
old = label;
628628
cell.append('%s: %s' % (k,old))
629-
if k in current:
629+
if current.has_key(k):
630630
cell[-1] += ' -> %s'%current[k]
631631
current[k] = old
632632

633633
elif isinstance(prop, hyperdb.Date) and args[k]:
634634
d = date.Date(args[k])
635635
cell.append('%s: %s'%(k, str(d)))
636-
if k in current:
636+
if current.has_key(k):
637637
cell[-1] += ' -> %s'%current[k]
638638
current[k] = str(d)
639639

640640
elif isinstance(prop, hyperdb.Interval) and args[k]:
641641
d = date.Interval(args[k])
642642
cell.append('%s: %s'%(k, str(d)))
643-
if k in current:
643+
if current.has_key(k):
644644
cell[-1] += ' -> %s'%current[k]
645645
current[k] = str(d)
646646

647647
elif isinstance(prop, hyperdb.String) and args[k]:
648648
cell.append('%s: %s'%(k, cgi.escape(args[k])))
649-
if k in current:
649+
if current.has_key(k):
650650
cell[-1] += ' -> %s'%current[k]
651651
current[k] = cgi.escape(args[k])
652652

653653
elif not args[k]:
654-
if k not in current:
655-
cell.append('%s: (no value)'%k)
656-
else:
654+
if current.has_key(k):
657655
cell.append('%s: %s'%(k, current[k]))
658656
current[k] = '(no value)'
657+
else:
658+
cell.append('%s: (no value)'%k)
659659

660660
else:
661661
cell.append('%s: %s'%(k, str(args[k])))
662-
if k in current:
662+
if current.has_key(k):
663663
cell[-1] += ' -> %s'%current[k]
664664
current[k] = str(args[k])
665665
else:

0 commit comments

Comments
 (0)