@staticmethod
    def cap_alert_onvalidation(form):

        form_vars_get = form.vars.get
        if not form_vars_get("is_template"):
            # For non templates
            if form_vars_get("scope") == "Private" and not form_vars_get("addresses"):
                form.errors["addresses"] = \
                    current.T("'Recipients' field mandatory in case of 'Private' scope")
    
            if form_vars_get("scope") == "Restricted" and not form_vars_get("restriction"):
                form.errors["restriction"] = \
                    current.T("'Restriction' field mandatory in case of 'Restricted' scope")
    
            if form_vars_get("addresses") and not form_vars_get("scope"):
                form.errors["scope"] = \
                    current.T("'Scope' field mandatory in case using 'Recipients' field")

    # -------------------------------------------------------------------------
Format and return the specified exception information as a string.
dataset/ETHPy150Open sahana/eden/modules/s3db/cap.py/S3CAPModel.cap_alert_onvalidation--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/logging/__init__.py/Formatter.formatException