(report_config)
return did_purge_something
Called when a report is deleted, this will remove any references to it in
    mobile UCR modules.
Called when a report is deleted, this will remove any references to it in
    mobile UCR modules.
Called when a report is deleted this will remove any references to it in mobile UCR modules .
def purge_report_from_mobile_ucr(report_config):
    """
    Called when a report is deleted, this will remove any references to it in
    mobile UCR modules.
    """
    if not toggles.MOBILE_UCR.enabled(report_config.domain):
        return False

    did_purge_something = False
    for app in get_apps_in_domain(report_config.domain):
        save_app = False
        for module in app.modules:
            if module.module_type == 'report':
                valid_report_configs = [
                    app_config for app_config in module.report_configs
                    if app_config.report_id != report_config._id
                ]
                if len(valid_report_configs) != len(module.report_configs):
                    module.report_configs = valid_report_configs
                    save_app = True
        if save_app:
            app.save()
            did_purge_something = True
    return did_purge_something
def purge_report_from_mobile_ucr ( report_config ) : if not toggles . MOBILE_UCR . enabled ( report_config . domain ) : return False did_purge_something = False for app in get_apps_in_domain ( report_config . domain ) : save_app = False for module in app . modules : if module . module_type == 'report' : valid_report_configs = [ app_config for app_config in module . report_configs if app_config . report_id != report_config . _id ] if len ( valid_report_configs ) != len ( module . report_configs ) : module . report_configs = valid_report_configs save_app = True if save_app : app . save ( ) did_purge_something = True return did_purge_something