@staticmethod
    def cap_alert_create_onaccept(form):

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

    # -------------------------------------------------------------------------
Auto-approve Templates
dataset/ETHPy150Open sahana/eden/modules/s3db/cap.py/S3CAPModel.cap_alert_create_onaccept