diff roundup/cgi/templating.py @ 1258:de0f879f995d

fixed history to display username instead of userid
author Richard Jones <richard@users.sourceforge.net>
date Thu, 10 Oct 2002 03:48:16 +0000
parents 77920c42aeb9
children db1ae414f363
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Thu Oct 10 03:48:02 2002 +0000
+++ b/roundup/cgi/templating.py	Thu Oct 10 03:48:16 2002 +0000
@@ -490,7 +490,7 @@
         # XXX do this
         return []
 
-    def history(self, direction='descending'):
+    def history(self, direction='descending', dre=re.compile('\d+')):
         l = ['<table class="history">'
              '<tr><th colspan="4" class="header">',
              _('History'),
@@ -629,6 +629,10 @@
                     handled by the history display!</em></strong>''')
                 arg_s = '<strong><em>' + str(args) + '</em></strong>'
             date_s = date_s.replace(' ', '&nbsp;')
+            # if the user's an itemid, figure the username (older journals
+            # have the username)
+            if dre.match(user):
+                user = self._db.user.get(user, 'username')
             l.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
                 date_s, user, action, arg_s))
         if comments:

Roundup Issue Tracker: http://roundup-tracker.org/