feat: improve on data privacy
This commit is contained in:
parent
2500a8d293
commit
641ae50265
6
main.py
6
main.py
@ -62,7 +62,11 @@ def add_players(players: list[Player]):
|
||||
def list_players():
|
||||
with Session(engine) as session:
|
||||
statement = select(Player).order_by(Player.display_name)
|
||||
return session.exec(statement).fetchall()
|
||||
players = session.exec(statement).fetchall()
|
||||
return [
|
||||
player.model_dump(include={"id", "display_name", "number"})
|
||||
for player in players
|
||||
]
|
||||
|
||||
|
||||
def list_teams():
|
||||
|
@ -283,7 +283,7 @@ async def change_password(
|
||||
async def read_player_me(
|
||||
current_user: Annotated[Player, Depends(get_current_active_user)],
|
||||
):
|
||||
return current_user
|
||||
return current_user.model_dump(exclude={"hashed_password", "disabled"})
|
||||
|
||||
|
||||
async def read_own_items(
|
||||
|
Loading…
x
Reference in New Issue
Block a user