From f2b7f8102c0f070bcfa2943ead65a9a92b9bd071 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 21 Oct 2025 20:11:31 -0500 Subject: [PATCH] CLAUDE: Fix /dropadd rejecting Minor League players from same organization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- commands/transactions/dropadd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/transactions/dropadd.py b/commands/transactions/dropadd.py index 97b725f..9183c22 100644 --- a/commands/transactions/dropadd.py +++ b/commands/transactions/dropadd.py @@ -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"