(request, configs, domain, owner_id, couch_user, email,
                           notes=None, attach_excel=False, once=False, lang=None,
                           send_only_active=False)
return response.content.decode("utf-8"), excel_attachments
Renders only notification's main content, which then may be used to generate full notification body.

    :returns: two-tuple `(report_text: str, excel_files: list)`. Both
    values are empty when there are no applicable report configs.
    `excel_files` is a list of dicts.
Renders only notification's main content, which then may be used to generate full notification body.
Renders only notification s main content which then may be used to generate full notification body .
def _render_report_configs(request, configs, domain, owner_id, couch_user, email,
                           notes=None, attach_excel=False, once=False, lang=None,
                           send_only_active=False):
    """
    Renders only notification's main content, which then may be used to generate full notification body.

    :returns: two-tuple `(report_text: str, excel_files: list)`. Both
    values are empty when there are no applicable report configs.
    `excel_files` is a list of dicts.
    """
    from dimagi.utils.web import get_url_base

    report_outputs = []
    excel_attachments = []
    format = Format.from_format(request.GET.get('format') or Format.XLS_2007)

    # Show only the report configs that have started their reporting period
    if send_only_active:
        configs = [c for c in configs if c.is_active]

    # Don't send an email if none of the reports configs have started
    if len(configs) == 0:
        return "", []

    for config in configs:
        content, excel_file = config.get_report_content(lang, attach_excel=attach_excel, couch_user=couch_user)
        if excel_file:
            excel_attachments.append({
                'title': config.full_name + "." + format.extension,
                'file_obj': excel_file,
                'mimetype': format.mimetype
            })
        date_range = config.get_date_range()
        report_outputs.append({
            'title': config.full_name,
            'url': config.url,
            'content': content,
            'is_active': config.is_active,
            'description': config.description,
            "startdate": date_range.get("startdate") if date_range else "",
            "enddate": date_range.get("enddate") if date_range else "",
        })

    response = render(request, "reports/report_email_content.html", {
        "reports": report_outputs,
        "domain": domain,
        "couch_user": owner_id,
        "DNS_name": get_url_base(),
        "owner_name": couch_user.full_name or couch_user.get_email(),
        "email": email,
        "notes": notes,
        "report_type": _("once off report") if once else _("scheduled report"),
    })
    return response.content.decode("utf-8"), excel_attachments
def _render_report_configs ( request , configs , domain , owner_id , couch_user , email , notes = None , attach_excel = False , once = False , lang = None , send_only_active = False ) : from dimagi . utils . web import get_url_base report_outputs = [ ] excel_attachments = [ ] format = Format . from_format ( request . GET . get ( 'format' ) or Format . XLS_2007 ) # Show only the report configs that have started their reporting period if send_only_active : configs = [ c for c in configs if c . is_active ] # Don't send an email if none of the reports configs have started if len ( configs ) == 0 : return "" , [ ] for config in configs : content , excel_file = config . get_report_content ( lang , attach_excel = attach_excel , couch_user = couch_user ) if excel_file : excel_attachments . append ( { 'title' : config . full_name + "." + format . extension , 'file_obj' : excel_file , 'mimetype' : format . mimetype } ) date_range = config . get_date_range ( ) report_outputs . append ( { 'title' : config . full_name , 'url' : config . url , 'content' : content , 'is_active' : config . is_active , 'description' : config . description , "startdate" : date_range . get ( "startdate" ) if date_range else "" , "enddate" : date_range . get ( "enddate" ) if date_range else "" , } ) response = render ( request , "reports/report_email_content.html" , { "reports" : report_outputs , "domain" : domain , "couch_user" : owner_id , "DNS_name" : get_url_base ( ) , "owner_name" : couch_user . full_name or couch_user . get_email ( ) , "email" : email , "notes" : notes , "report_type" : _ ( "once off report" ) if once else _ ( "scheduled report" ) , } ) return response . content . decode ( "utf-8" ) , excel_attachments