'Auto-approve Templates'

@staticmethod
def cap_alert_create_onaccept(form):

    db = current.db
    form_vars = form.vars
    table = current.s3db.cap_alert
    if form_vars.get('is_template'):
        user = current.auth.user
        if user:
            db((table.id == form_vars.id)).update(approved_by=user.id)
