major-domo-v2/commands
Cal Corum 0c001b6dab Fix @requires_team decorator API error handling
The @requires_team() decorator was incorrectly treating API errors as "no team"
because get_user_team() was catching all exceptions and returning None.

Changes:
1. get_user_team() now propagates exceptions instead of catching them
   - Allows callers to distinguish between "no team found" vs "API error"
   - Updated docstring to document the exception behavior

2. @requires_team() decorator now has try-except block
   - Returns specific error for "no team" (None result)
   - Returns helpful error for API/network issues (exception caught)
   - Logs exceptions for debugging

3. league_admin_only() decorator enhanced
   - Now supports both slash commands (Interaction) and prefix commands (Context)
   - Unified error handling for both command types

4. team_service.py and related updates
   - Team model field name corrected: team_abbrev -> abbrev

This fixes the regression where /cc-create was failing with "no team" error
when it should have been showing an API error message or working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:31:14 -06:00
..
admin Fix @requires_team decorator API error handling 2025-11-14 09:31:14 -06:00
custom_commands Fix /cc-create command creating twice instead of waiting for confirmation 2025-11-14 08:28:45 -06:00
dice CLAUDE: Refactor dice rolling into reusable utility module and add /d20 command 2025-10-29 01:15:11 -05:00
draft CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
examples CLAUDE: Refine injury roll display and cleanup imports 2025-10-16 22:20:13 -05:00
gameplay CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
help CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
injuries CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
league CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
players Allow any user to toggle player stats 2025-10-21 13:06:03 -05:00
profile CLAUDE: Add comprehensive CLAUDE.md documentation files for AI agent guidance 2025-10-20 20:30:07 -05:00
soak Refactored listener logic and added SpoilerListener 2025-10-22 14:59:19 -05:00
spoiler Refactored listener logic and added SpoilerListener 2025-10-22 14:59:19 -05:00
teams CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
transactions CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
utilities CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
voice CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00
__init__.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
CLAUDE.md CLAUDE: Add comprehensive CLAUDE.md documentation files for AI agent guidance 2025-10-20 20:30:07 -05:00