CLAUDE: Fix /dropadd rejecting Minor League players from same organization

Bug: /dropadd was incorrectly rejecting players from Minor League affiliates
Root Cause: Ownership check used team.id comparison instead of organizational check
Fix: Use team.is_same_organization() to properly handle ML/MiL/IL affiliates

Before: player.team.id != builder.team.id (fails for WVMiL when user owns WV)
After: not builder.team.is_same_organization(player.team) (correctly identifies same org)

This brings /dropadd in line with /ilmove implementation which already used
the correct organizational check pattern.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-10-21 20:11:31 -05:00
parent 267f14576a
commit f2b7f8102c

View File

@ -147,9 +147,9 @@ class DropAddCommands(commands.Cog):
# Player belongs to another team if:
# 1. They have a team assigned AND
# 2. That team is not Free Agency (abbrev != 'FA') AND
# 3. That team is not the user's team
# 3. That team is not in the same organization as the user's team
if (player.team.abbrev != 'FA' and
player.team.id != builder.team.id):
not builder.team.is_same_organization(player.team)):
self.logger.warning(f"Player {player.name} belongs to {player.team.abbrev}, cannot add to {builder.team.abbrev} transaction")
return False, f"{player.name} belongs to {player.team.abbrev} and cannot be added to your transaction"