This reactor generates a nosy-like message to be sent to parties who wish to be notified whenever a new issue is created (the "team@team.host" address list).
1 from roundup import roundupdb
2
3 def newissuecopy(db, cl, nodeid, oldvalues):
4 ''' Copy a message about new issues to a team address.
5 '''
6 # so use all the messages in the create
7 change_note = cl.generateCreateNote(nodeid)
8
9 # send a copy to the nosy list
10 for msgid in cl.get(nodeid, 'messages'):
11 try:
12 # note: last arg must be a list
13 cl.send_message(nodeid, msgid, change_note, ['team@team.host'])
14 except roundupdb.MessageSendError, message:
15 raise roundupdb.DetectorError, message
16
17 def init(db):
18 db.issue.react('create', newissuecopy)