view website/issues/detectors/newissuecopy.py @ 5120:722394a48d7b

issue2550831: Make the classic template query.edit page work. R David Murray had a number of fixes. At least some of the fixes were already present in the devel and responsive templates. I touched up the html a bit and did what I hope aresome improvement for performance by shoving criteria into the filter rather than looping over all issues and filtering at the tal level. Also used R David's method to add a restore feature and work around an issue where a retired (deleted) query could still be in the active list. But because it was retired there was no way to manipulate it.
author John Rouillard <rouilj@ieee.org>
date Sun, 03 Jul 2016 12:23:36 -0400
parents b622e150c0ba
children 198b6e810c67
line wrap: on
line source

from roundup import roundupdb

def newissuecopy(db, cl, nodeid, oldvalues):
    ''' Copy a message about new issues to a team address.
    '''
    # so use all the messages in the create
    change_note = cl.generateCreateNote(nodeid)

    # send a copy to the nosy list
    for msgid in cl.get(nodeid, 'messages'):
        try:
            # note: last arg must be a list
            cl.send_message(nodeid, msgid, change_note,
                ['r1chardj0n3s@gmail.com', 
                    'roundup-devel@lists.sourceforge.net'])
        except roundupdb.MessageSendError, message:
            raise roundupdb.DetectorError, message

def init(db):
    db.issue.react('create', newissuecopy)

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