Loading running_exercise/lib/opensearch_client.py +15 −13 Original line number Diff line number Diff line Loading @@ -40,13 +40,11 @@ def create_opensearch_exercise(team_ids): username = f"team-{team_id}" # TODO: Generate a strong password for each user password = f"v&ery6#7st*ong78288732-pass889329word-aVUfg9{team_id}" credentials[team_id] = ( { credentials[team_id] = { "index_name": index_name, "username": username, "password": password, } ) user_body = { "password": password, } Loading Loading @@ -135,7 +133,11 @@ def get_exercise_opensearch_data(exercise_id) -> List[OpenSearchDataType]: responses = msearch_result.get("responses", []) result = [] for response in responses: if "hits" in response and "hits" in response["hits"] and len(response["hits"]["hits"]) > 0: if ( "hits" in response and "hits" in response["hits"] and len(response["hits"]["hits"]) > 0 ): result.append( OpenSearchDataType( id=response["hits"]["hits"][0]["_id"], Loading Loading
running_exercise/lib/opensearch_client.py +15 −13 Original line number Diff line number Diff line Loading @@ -40,13 +40,11 @@ def create_opensearch_exercise(team_ids): username = f"team-{team_id}" # TODO: Generate a strong password for each user password = f"v&ery6#7st*ong78288732-pass889329word-aVUfg9{team_id}" credentials[team_id] = ( { credentials[team_id] = { "index_name": index_name, "username": username, "password": password, } ) user_body = { "password": password, } Loading Loading @@ -135,7 +133,11 @@ def get_exercise_opensearch_data(exercise_id) -> List[OpenSearchDataType]: responses = msearch_result.get("responses", []) result = [] for response in responses: if "hits" in response and "hits" in response["hits"] and len(response["hits"]["hits"]) > 0: if ( "hits" in response and "hits" in response["hits"] and len(response["hits"]["hits"]) > 0 ): result.append( OpenSearchDataType( id=response["hits"]["hits"][0]["_id"], Loading