def get_registered_from(registration):
 if registration.registered_from:
  return registration.registered_from_id
 else:
  first_log_id = db['node'].find_one({'_id': registration._id})['logs'][0]
  log = NodeLog.load(first_log_id)
  return (log.params.get('node') or log.params.get('project'))

def get_registered_from ( registration ) : if registration . registered_from : return registration . registered_from_id else : first_log_id = db [ 'node' ] . find_one ( { '_id' : registration . _id } ) [ 'logs' ] [ 0 ] log = NodeLog . load ( first_log_id ) return ( log . params . get ( 'node' ) or log . params . get ( 'project' ) )
gets node registration was registered from .