view website/issues/detectors/statusauditor.py @ 5315:5a014410f254

Fix issue2550954: History display breaks .. on removed properties: Now changes to removed properties, and link/unlink events from non-existing properties or classes no longer trigger a traceback. Concerning the visibility: We have a new config-item obsolete_history_roles in the main section that defines which roles may see removed properties. By default only role Admin is allowed to see these.
author Ralf Schlatterbeck <rsc@runtux.com>
date Thu, 19 Apr 2018 12:59:23 +0200
parents c2d0d3e9099d
children 0942fe89e82e
line wrap: on
line source

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

    if newvalues.has_key('status') 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/