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:
parent
151cf088da
commit
7a5e85323b
@ -247,9 +247,11 @@ class SubmitConfirmationModal(discord.ui.Modal):
|
|||||||
# POST transactions to database
|
# POST transactions to database
|
||||||
created_transactions = await transaction_service.create_transaction_batch(transactions)
|
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)
|
||||||
bot = interaction.client
|
# During freeze period, transactions are hidden until Saturday processing
|
||||||
await post_transaction_to_log(bot, created_transactions, team=self.builder.team)
|
if not current_state.freeze:
|
||||||
|
bot = interaction.client
|
||||||
|
await post_transaction_to_log(bot, created_transactions, team=self.builder.team)
|
||||||
|
|
||||||
# Create success message
|
# Create success message
|
||||||
success_msg = f"✅ **Transaction Submitted Successfully!**\n\n"
|
success_msg = f"✅ **Transaction Submitted Successfully!**\n\n"
|
||||||
@ -261,7 +263,10 @@ class SubmitConfirmationModal(discord.ui.Modal):
|
|||||||
for move in self.builder.moves:
|
for move in self.builder.moves:
|
||||||
success_msg += f"• {move.description}\n"
|
success_msg += f"• {move.description}\n"
|
||||||
|
|
||||||
success_msg += f"\n💡 Use `/mymoves` to check transaction status"
|
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)
|
await interaction.followup.send(success_msg, ephemeral=True)
|
||||||
|
|
||||||
@ -286,9 +291,11 @@ class SubmitConfirmationModal(discord.ui.Modal):
|
|||||||
)
|
)
|
||||||
player_updates.append(updated_player)
|
player_updates.append(updated_player)
|
||||||
|
|
||||||
# Post to #transaction-log channel
|
# Post to #transaction-log channel (only when league is NOT frozen)
|
||||||
bot = interaction.client
|
# During freeze period, IL moves are hidden until Saturday processing
|
||||||
await post_transaction_to_log(bot, created_transactions, team=self.builder.team)
|
if not current_state.freeze:
|
||||||
|
bot = interaction.client
|
||||||
|
await post_transaction_to_log(bot, created_transactions, team=self.builder.team)
|
||||||
|
|
||||||
# Create success message
|
# Create success message
|
||||||
success_msg = f"✅ **IL Move Executed Successfully!**\n\n"
|
success_msg = f"✅ **IL Move Executed Successfully!**\n\n"
|
||||||
@ -302,6 +309,9 @@ class SubmitConfirmationModal(discord.ui.Modal):
|
|||||||
|
|
||||||
success_msg += f"\n✅ **All players have been moved to their new teams immediately**"
|
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)
|
await interaction.followup.send(success_msg, ephemeral=True)
|
||||||
|
|
||||||
# Clear the builder after successful submission
|
# Clear the builder after successful submission
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user