From 39bc99b0dd7b5ec2a7cf6f32857df37dfccddf05 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 5 Feb 2026 19:43:50 -0600 Subject: [PATCH] fix: Respect short_output parameter in player search endpoint The search_players() method was hardcoding short_output=True when converting query results to dicts, ignoring the function parameter. This caused the /api/v3/players/search endpoint to always return team_id as an integer instead of nested team objects, even when short_output=False was specified. Impact: - Discord bot's /injury clear command was crashing because player.team was None (only team_id was populated) - Any code using search endpoint couldn't get full team data Fix: - Changed line 386 to use the short_output parameter value - Now respects short_output parameter: False returns full team objects, True returns just team IDs Root cause analysis from production logs: - Error: AttributeError: 'NoneType' object has no attribute 'roster_type' - Location: commands/injuries/management.py:647 - Cause: player.team was None after search_players() call Co-Authored-By: Claude Sonnet 4.5 --- app/services/player_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/player_service.py b/app/services/player_service.py index f9c9851..a0bacd1 100644 --- a/app/services/player_service.py +++ b/app/services/player_service.py @@ -383,7 +383,7 @@ class PlayerService(BaseService): # Convert to dicts if needed all_player_dicts = cls._query_to_player_dicts( - InMemoryQueryResult(all_players), short_output=True + InMemoryQueryResult(all_players), short_output=short_output ) # Sort by relevance (exact matches first)