major-domo-v2/commands/admin
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
..
__init__.py CLAUDE: Add automated weekly transaction freeze/thaw system 2025-10-20 12:16:13 -05:00
league_management.py Update league_management.py 2025-11-06 22:11:56 -06:00
management.py Fix @requires_team decorator API error handling 2025-11-14 09:31:14 -06:00
users.py CLAUDE: Add flexible permission system for multi-server support 2025-11-06 11:29:29 -06:00