Skip to content

Commit 237ba65

Browse files
author
Richard Jones
committed
fixed history to display username instead of userid
1 parent 7133f72 commit 237ba65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

roundup/cgi/templating.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def journal(self, direction='descending'):
490490
# XXX do this
491491
return []
492492

493-
def history(self, direction='descending'):
493+
def history(self, direction='descending', dre=re.compile('\d+')):
494494
l = ['<table class="history">'
495495
'<tr><th colspan="4" class="header">',
496496
_('History'),
@@ -629,6 +629,10 @@ def history(self, direction='descending'):
629629
handled by the history display!</em></strong>''')
630630
arg_s = '<strong><em>' + str(args) + '</em></strong>'
631631
date_s = date_s.replace(' ', '&nbsp;')
632+
# if the user's an itemid, figure the username (older journals
633+
# have the username)
634+
if dre.match(user):
635+
user = self._db.user.get(user, 'username')
632636
l.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
633637
date_s, user, action, arg_s))
634638
if comments:

0 commit comments

Comments
 (0)