[Python-checkins] r70399 - tracker/roundup-src/roundup/roundupdb.py

martin.v.loewis python-checkins at python.org
Sun Mar 15 22:58:38 CET 2009


Author: martin.v.loewis
Date: Sun Mar 15 22:58:38 2009
New Revision: 70399

Log:
Reapply r54384 (erik.forsberg):
Extensions to roundup to allow author of property-only changes to be
seen.

Use of these extensions in busybody.py.

Should fix problem noted in msg322 of
http://psf.upfronthosting.co.za/roundup/meta/issue32.


Modified:
   tracker/roundup-src/roundup/roundupdb.py

Modified: tracker/roundup-src/roundup/roundupdb.py
==============================================================================
--- tracker/roundup-src/roundup/roundupdb.py	(original)
+++ tracker/roundup-src/roundup/roundupdb.py	Sun Mar 15 22:58:38 2009
@@ -278,7 +278,7 @@
     sendmessage = nosymessage
 
     def send_message(self, nodeid, msgid, note, sendto, from_address=None,
-            bcc_sendto=[]):
+            bcc_sendto=[], authid=None):
         '''Actually send the nominated message from this node to the sendto
            recipients, with the note appended.
         '''
@@ -308,7 +308,12 @@
         title = self.get(nodeid, 'title') or '%s message copy'%cn
 
         # figure author information
-        if msgid:
+        if authid:
+            authname = users.get(authid, 'realname')
+            if not authname:
+                authname = users.get(authid, 'username', '')
+            authaddr = users.get(authid, 'address', '')            
+        elif msgid:
             authid = messages.get(msgid, 'author')
         else:
             authid = self.db.getuid()
@@ -338,7 +343,8 @@
                 m.append(_("%(authname)s%(authaddr)s added the comment:")
                     % locals())
             else:
-                m.append(_("Change by %(authname)s%(authaddr)s:") % locals())
+                m.append(_("Changes by %(authname)s%(authaddr)s:")
+                         % locals())
             m.append('')
 
         # add the content


More information about the Python-checkins mailing list