From a828cc68c39e5427e4368ab58fbe7d4c1acbdc1e Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 8 Apr 2002 03:46:42 +0000 Subject: [PATCH] make it work git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@698 57a73879-2fb5-44c3-a270-3262357dd7e2 --- detectors/newissuecopy.py | 3 ++- roundup/roundupdb.py | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/detectors/newissuecopy.py b/detectors/newissuecopy.py index 7bcb6de..852069d 100644 --- a/detectors/newissuecopy.py +++ b/detectors/newissuecopy.py @@ -11,7 +11,8 @@ def newissuecopy(db, cl, nodeid, oldvalues): # send a copy to the nosy list for msgid in cl.get(nodeid, 'messages'): try: - cl.send_message(nodeid, msgid, change_note, 'team@team.host') + # note: last arg must be a list + cl.send_message(nodeid, msgid, change_note, ['team@team.host']) except roundupdb.MessageSendError, message: raise roundupdb.DetectorError, message diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index c9d2912..d126456 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.50 2002-04-08 03:40:31 richard Exp $ +# $Id: roundupdb.py,v 1.51 2002-04-08 03:46:42 richard Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -343,6 +343,9 @@ class IssueClass(Class): # we have new recipients if sendto: + # map userids to addresses + sendto = [users.get(i, 'address') for i in sendto] + # update the message's recipients list messages.set(msgid, recipients=recipients) @@ -372,14 +375,11 @@ class IssueClass(Class): self.classname, nodeid, self.db.config.MAIL_DOMAIN) messages.set(msgid, messageid=messageid) - # figure the author's id - authid = messages.get(msgid, 'author') - # send an email to the people who missed out - sendto = [users.get(i, 'address') for i in sendto] cn = self.classname title = self.get(nodeid, 'title') or '%s message copy'%cn # figure author information + authid = messages.get(msgid, 'author') authname = users.get(authid, 'realname') if not authname: authname = users.get(authid, 'username') @@ -620,6 +620,15 @@ class IssueClass(Class): # # $Log: not supported by cvs2svn $ +# Revision 1.50 2002/04/08 03:40:31 richard +# . added a "detectors" directory for people to put their useful auditors and +# reactors in. Note - the roundupdb.IssueClass.sendmessage method has been +# split and renamed "nosymessage" specifically for things like the nosy +# reactor, and "send_message" which just sends the message. +# +# The initial detector is one that we'll be using here at ekit - it bounces new +# issue messages to a team address. +# # Revision 1.49 2002/03/19 06:41:49 richard # Faster, easier, less mess ;) # -- 2.30.2