paper-dynasty-discord/utilities
Cal Corum 51004ea143 Fix bot crash when substituting player without eligible position
Bug: When a user attempted to substitute a player who didn't have the required
position rating, the bot would display an error message but leave the database
session in an inconsistent state. The old player was marked inactive and flushed
to the session, but when the position check failed, the function returned early
without rolling back the session. This left the session dirty, causing crashes
on subsequent operations.

Fix: Added session.rollback() before returning when PositionNotFoundException
is caught, ensuring the database session is cleanly reset.

Location: utilities/dropdown.py:479-480 in SelectBatterSub.callback()

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 16:02:35 -06:00
..
autocomplete.py Added search functionality to /player command 2025-10-08 14:45:41 -05:00
buttons.py New postion sub logic 2025-03-09 00:59:10 -06:00
dropdown.py Fix bot crash when substituting player without eligible position 2025-11-12 16:02:35 -06:00
embeds.py Gauntlet evolution fix 2025-02-09 21:38:19 -06:00
pages.py Added Brilliant Stars gauntlet 2024-12-24 00:22:30 -06:00
supabase.py Remove outdate image links 2025-06-04 09:54:13 -05:00