def reference_links(doc):
    """Get reference links"""
    if doc.get('type') == 'organisation' and doc.get('state') != 'deactivated':
        for asset_id_type, link in doc.get('reference_links', {}).get('links', {}).items():
            value = {
                'organisation_id': doc['_id'],
                'link': link
            }
            yield asset_id_type, value
def reference_links ( doc ) : if doc . get ( 'type' ) == 'organisation' and doc . get ( 'state' ) != 'deactivated' : for asset_id_type , link in doc . get ( 'reference_links' , { } ) . get ( 'links' , { } ) . items ( ) : value = { 'organisation_id' : doc [ '_id' ] , 'link' : link } yield asset_id_type , value
Get reference links