fix: Prevent locals() from polluting player PATCH data dict #4
@ -117,12 +117,13 @@ async def patch_player(
|
|||||||
):
|
):
|
||||||
"""Patch a player (partial update)."""
|
"""Patch a player (partial update)."""
|
||||||
# Build dict of provided fields
|
# Build dict of provided fields
|
||||||
data = {}
|
# IMPORTANT: Capture locals() BEFORE creating data dict to avoid including 'data' itself
|
||||||
locals_dict = locals()
|
locals_dict = locals()
|
||||||
|
data = {}
|
||||||
for key, value in locals_dict.items():
|
for key, value in locals_dict.items():
|
||||||
if key not in ('player_id', 'token') and value is not None:
|
if key not in ('player_id', 'token', 'locals_dict') and value is not None:
|
||||||
data[key] = value
|
data[key] = value
|
||||||
|
|
||||||
return PlayerService.patch_player(player_id, data, token)
|
return PlayerService.patch_player(player_id, data, token)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user