@must_be_signed
@must_have_addon('osfstorage', 'node')
def osfstorage_update_metadata(node_addon, payload, **kwargs):
    try:
        version_id = payload['version']
        metadata = payload['metadata']
    except __HOLE__:
        raise HTTPError(httplib.BAD_REQUEST)

    version = models.FileVersion.load(version_id)

    if version is None:
        raise HTTPError(httplib.NOT_FOUND)

    version.update_metadata(metadata)

    return {'status': 'success'}
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/osfstorage/views.py/osfstorage_update_metadata