(app_source)
return app_source
Make new report UUIDs so they stay unique

    Otherwise there would be multiple reports in the restore with the same UUID
    Set the report slug to the old UUID so any xpath expressions referencing
    the report by ID continue to work, if only in mobile UCR v2
Make new report UUIDs so they stay unique
Make new report UUIDs so they stay unique
def update_report_module_ids(app_source):
    """Make new report UUIDs so they stay unique

    Otherwise there would be multiple reports in the restore with the same UUID
    Set the report slug to the old UUID so any xpath expressions referencing
    the report by ID continue to work, if only in mobile UCR v2
    """
    app_source = deepcopy(app_source)
    for module in app_source['modules']:
        if module['module_type'] == 'report':
            for config in module['report_configs']:
                if not config.get('report_slug'):
                    config['report_slug'] = config['uuid']
                config['uuid'] = uuid.uuid4().hex
    return app_source
def update_report_module_ids ( app_source ) : app_source = deepcopy ( app_source ) for module in app_source [ 'modules' ] : if module [ 'module_type' ] == 'report' : for config in module [ 'report_configs' ] : if not config . get ( 'report_slug' ) : config [ 'report_slug' ] = config [ 'uuid' ] config [ 'uuid' ] = uuid . uuid4 ( ) . hex return app_source