Reviewer correctly identified that removing the finally block introduced
real connection leaks for handlers that do not call db.close() on their
own error paths. Peewee's PooledDatabase.close() is a no-op on the second
call, so double-close is harmless — the finally block provides necessary
safety net.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the `finally` block that called `db.close()` after rollback in
the `handle_db_errors` decorator. With connection pooling, route handlers
already call `db.close()` themselves, so closing again in the error handler
could return connections to the pool twice, corrupting pool state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>