view website/issues/detectors/severityauditor.py @ 7694:54eb12cd3be1

fix: make task index not crash. It looks like the task.index.html page was a copy of bug.index.html. However some fields are missing from a task that is in a bug. This causes a crash when looking at all tasks if you don't explicitly select the fields to be displayed. The task links from the sidebar do explicitly select @columns fields, so the crash is not normally seen.
author John Rouillard <rouilj@ieee.org>
date Sun, 05 Nov 2023 22:31:40 -0500
parents 0942fe89e82e
children
line wrap: on
line source


def init_severity(db, cl, nodeid, newvalues):
    """Make sure severity is set on new issues"""
    if 'severity' in newvalues and newvalues['severity']:
        return

    normal = db.severity.lookup('normal')
    newvalues['severity'] = normal

def init(db):
    db.issue.audit('create', init_severity)

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