Skip to content

Commit

Permalink
BUG FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed May 22, 2024
1 parent 891e6ea commit 974306d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ async def select_player(session: AsyncSession, name: str) -> PlayerInDB:


async def insert_player(session: AsyncSession, player: PlayerCreate) -> PlayerInDB:
player.name = player.name.lower().replace("_", " ").replace("-", " ").strip()
sql: Insert = insert(Player)
sql = sql.values(player.model_dump())
await session.execute(sql)
return await select_player(session=session, name=player.name)


async def get_or_create_player(session: AsyncSession, player_name: str) -> PlayerInDB:
player_name = player_name.lower().replace("_", " ").replace("-", " ").strip()
player = await select_player(session=session, name=player_name)
# create reporter
if player is None:
Expand Down

0 comments on commit 974306d

Please sign in to comment.