def migrate_log(logs):
    logs_count = logs.count()
    count = 0
    for log in logs:
        count += 1
        node = log.params.get('node') or log.params.get('project')
        params_node = Node.load(node)
        if params_node.is_registration:
            log.params['node'] = get_registered_from(params_node)
            log.params['registration'] = params_node._id
        else:
            # For logs where params['node'] already equal to node (registration_approval logs, and logs with errors in registration_cancelled)
            log.params['registration'] = RegistrationApproval.load(log.params['registration_approval_id'])._get_registration()._id

        log.save()
        logger.info('{}/{} Finished migrating log {}: registration action {}. params[node]={} and params[registration]={}'.format(count,
            logs_count, log._id, log.action, log.params['node'], log.params['registration']))
Decorator that registers a path template field computation.
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/migrate_registration_logs.py/migrate_log--crossover with--dataset/ETHPy150Open beetbox/beets/beets/plugins.py/BeetsPlugin.template_field