(domain, user_ids)
return list(chain(*location_ids))
Get the ids of the locations the users are assigned to
Get the ids of the locations the users are assigned to
Get the ids of the locations the users are assigned to
def get_users_location_ids(domain, user_ids):
    """Get the ids of the locations the users are assigned to"""
    result = (UserES()
              .domain(domain)
              .user_ids(user_ids)
              .non_null('assigned_location_ids')
              .source(['assigned_location_ids'])
              .run())
    location_ids = [r['assigned_location_ids'] for r in result.hits if 'assigned_location_ids' in r]
    return list(chain(*location_ids))
def get_users_location_ids ( domain , user_ids ) : result = ( UserES ( ) . domain ( domain ) . user_ids ( user_ids ) . non_null ( 'assigned_location_ids' ) . source ( [ 'assigned_location_ids' ] ) . run ( ) ) location_ids = [ r [ 'assigned_location_ids' ] for r in result . hits if 'assigned_location_ids' in r ] return list ( chain ( * location_ids ) )