'Incident Category Validation:
Prevent Duplicates
Done here rather than in .requires to maintain the dropdown.'

@staticmethod
def irs_icategory_onvalidation(form):

    db = current.db
    table = db.irs_icategory
    (category, error) = IS_NOT_ONE_OF(db, 'irs_icategory.code')(form.vars.code)
    if error:
        form.errors.code = error
    return False
