1 # copied from nosyreaction
3 from roundup import roundupdb
5 def newissuecopy(db, cl, nodeid, oldvalues):
6 ''' Copy a message about new issues to a team address.
7 '''
8 # so use all the messages in the create
9 change_note = cl.generateCreateNote(nodeid)
11 # send a copy to the nosy list
12 for msgid in cl.get(nodeid, 'messages'):
13 try:
14 # note: last arg must be a list
15 cl.send_message(nodeid, msgid, change_note, ['team@team.host'])
16 except roundupdb.MessageSendError, message:
17 raise roundupdb.DetectorError, message
19 def init(db):
20 db.issue.react('create', newissuecopy)
22 # vim: set filetype=python ts=4 sw=4 et si