From 6a08c50452491e36b70402d3d634036a896f352b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 9 Jan 2025 12:10:52 -0600 Subject: [PATCH] fix: flush session when removing batch row otherwise if caller doesn't flush, could become confused. e.g. for some reason `batch.row_count` did not appear updated until flush --- src/wuttjamaican/batch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wuttjamaican/batch.py b/src/wuttjamaican/batch.py index 4d18b9c..0d47545 100644 --- a/src/wuttjamaican/batch.py +++ b/src/wuttjamaican/batch.py @@ -309,6 +309,7 @@ class BatchHandler(GenericHandler): should (usually) override :meth:`remove_row()` etc. """ batch = row.batch + session = self.app.get_session(batch) self.remove_row(row) @@ -316,6 +317,7 @@ class BatchHandler(GenericHandler): batch.row_count -= 1 self.refresh_batch_status(batch) + session.flush() def remove_row(self, row): """