Skip to content

Commit

Permalink
work on name instead of normalized name
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Mar 17, 2024
1 parent f60feaa commit 2e7098d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/v1/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ async def insert_report(
logger.debug(f"{data=}")

# Create entries for players that do not yet exist in Players table
existing_names = [d["normalized_name"] for d in data]
existing_names = [d["name"] for d in data]
logger.debug(f"{existing_names=}") # [NONE, NONE]
new_names = set([name for name in valid_names]).difference(existing_names)
logger.debug(f"{new_names=}")
Expand Down Expand Up @@ -313,7 +313,7 @@ async def insert_report(
)
return

df = df.merge(df_names, left_on="reported", right_on="normalized_name")
df = df.merge(df_names, left_on="reported", right_on="name")

if len(df) == 0:
logger.warning(
Expand All @@ -327,7 +327,7 @@ async def insert_report(
logger.warning({"message": "No reporter", "detections": detections})
return

reporter_id = df_names.query(f"normalized_name == {reporter}")["id"].to_list()
reporter_id = df_names.query(f"name == {reporter}")["id"].to_list()

if len(reporter_id) == 0:
logger.warning({"message": "No reporter in df_names", "detections": detections})
Expand Down

0 comments on commit 2e7098d

Please sign in to comment.