view website/issues/detectors/statusauditor.py @ 5507:0db3779702d9

access exception args in a Python 3 compatible way
author Christof Meerwald <cmeerw@cmeerw.org>
date Fri, 17 Aug 2018 19:44:12 +0100
parents 0942fe89e82e
children 13e8f188f8dd
line wrap: on
line source

def preset_new(db, cl, nodeid, newvalues):
    """ Make sure the status is set on new issues"""

    if 'status' in newvalues and newvalues['status']:
        return

    new = db.status.lookup('new')
    newvalues['status'] = new


def init(db):
    # fire before changes are made
    db.issue.audit('create', preset_new)

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