(couch_user, domain, scheduled_report_id,
                                  email=True, attach_excel=False,
                                  send_only_active=False, request=None)
return _render_report_configs(
        request,
        scheduled_report.configs,
        scheduled_report.domain,
        scheduled_report.owner_id,
        couch_user,
        email,
        attach_excel=attach_excel,
        lang=scheduled_report.language,
        send_only_active=send_only_active,
    )
This function somewhat confusingly returns a tuple of: (response, excel_files)
    If attach_excel is false, excel_files will always be an empty list.
    If send_only_active is True, then only ReportConfigs that have a start_date
    in the past will be sent. If none of the ReportConfigs are valid, no email will
    be sent.
This function somewhat confusingly returns a tuple of: (response, excel_files)
    If attach_excel is false, excel_files will always be an empty list.
    If send_only_active is True, then only ReportConfigs that have a start_date
    in the past will be sent. If none of the ReportConfigs are valid, no email will
    be sent.
This function somewhat confusingly returns a tuple of : ( response excel_files ) If attach_excel is false excel_files will always be an empty list . If send_only_active is True then only ReportConfigs that have a start_date in the past will be sent . If none of the ReportConfigs are valid no email will be sent .
def get_scheduled_report_response(couch_user, domain, scheduled_report_id,
                                  email=True, attach_excel=False,
                                  send_only_active=False, request=None):
    """
    This function somewhat confusingly returns a tuple of: (response, excel_files)
    If attach_excel is false, excel_files will always be an empty list.
    If send_only_active is True, then only ReportConfigs that have a start_date
    in the past will be sent. If none of the ReportConfigs are valid, no email will
    be sent.
    """
    # todo: clean up this API?
    domain_obj = Domain.get_by_name(domain)
    if not user_can_view_reports(domain_obj, couch_user):
        raise Http404

    scheduled_report = ReportNotification.get_report(scheduled_report_id)
    if not scheduled_report:
        raise Http404

    if not (scheduled_report.domain == domain and scheduled_report.can_be_viewed_by(couch_user)):
        raise Http404

    from django.http import HttpRequest
    if not request:
        request = HttpRequest()
        request.couch_user = couch_user
        request.user = couch_user.get_django_user()
        request.domain = domain
        request.couch_user.current_domain = domain

    return _render_report_configs(
        request,
        scheduled_report.configs,
        scheduled_report.domain,
        scheduled_report.owner_id,
        couch_user,
        email,
        attach_excel=attach_excel,
        lang=scheduled_report.language,
        send_only_active=send_only_active,
    )
def get_scheduled_report_response ( couch_user , domain , scheduled_report_id , email = True , attach_excel = False , send_only_active = False , request = None ) : # todo: clean up this API? domain_obj = Domain . get_by_name ( domain ) if not user_can_view_reports ( domain_obj , couch_user ) : raise Http404 scheduled_report = ReportNotification . get_report ( scheduled_report_id ) if not scheduled_report : raise Http404 if not ( scheduled_report . domain == domain and scheduled_report . can_be_viewed_by ( couch_user ) ) : raise Http404 from django . http import HttpRequest if not request : request = HttpRequest ( ) request . couch_user = couch_user request . user = couch_user . get_django_user ( ) request . domain = domain request . couch_user . current_domain = domain return _render_report_configs ( request , scheduled_report . configs , scheduled_report . domain , scheduled_report . owner_id , couch_user , email , attach_excel = attach_excel , lang = scheduled_report . language , send_only_active = send_only_active , )