Fix transaction freeze bypass - respect Current.freeze before posting to #transaction-log

Bug: Transactions were being posted to #transaction-log even when Current.freeze=True.
Transactions should only be posted when Current.freeze=False.

Fix: Added freeze state checks before calling post_transaction_to_log() in both
scheduled (/dropadd) and immediate (/ilmove) submission handlers.

When frozen:
- Transactions are still saved to DB with frozen=True
- NOT posted to #transaction-log (hidden until Saturday processing)
- User sees "Transaction saved during freeze period" message

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-12-15 17:47:33 -06:00
parent 151cf088da
commit 7a5e85323b
2 changed files with 18 additions and 8 deletions

View File

@ -1 +1 @@
2.24.7
2.24.8

View File

@ -247,7 +247,9 @@ class SubmitConfirmationModal(discord.ui.Modal):
# POST transactions to database
created_transactions = await transaction_service.create_transaction_batch(transactions)
# Post to #transaction-log channel
# Post to #transaction-log channel (only when league is NOT frozen)
# During freeze period, transactions are hidden until Saturday processing
if not current_state.freeze:
bot = interaction.client
await post_transaction_to_log(bot, created_transactions, team=self.builder.team)
@ -261,6 +263,9 @@ class SubmitConfirmationModal(discord.ui.Modal):
for move in self.builder.moves:
success_msg += f"{move.description}\n"
if current_state.freeze:
success_msg += f"\n🔒 Transaction saved during freeze period - will be revealed Saturday"
else:
success_msg += f"\n💡 Use `/mymoves` to check transaction status"
await interaction.followup.send(success_msg, ephemeral=True)
@ -286,7 +291,9 @@ class SubmitConfirmationModal(discord.ui.Modal):
)
player_updates.append(updated_player)
# Post to #transaction-log channel
# Post to #transaction-log channel (only when league is NOT frozen)
# During freeze period, IL moves are hidden until Saturday processing
if not current_state.freeze:
bot = interaction.client
await post_transaction_to_log(bot, created_transactions, team=self.builder.team)
@ -302,6 +309,9 @@ class SubmitConfirmationModal(discord.ui.Modal):
success_msg += f"\n✅ **All players have been moved to their new teams immediately**"
if current_state.freeze:
success_msg += f"\n🔒 Move logged but hidden during freeze period - will be revealed Saturday"
await interaction.followup.send(success_msg, ephemeral=True)
# Clear the builder after successful submission