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
This commit is contained in:
parent
0bb0a51f32
commit
6a08c50452
|
@ -309,6 +309,7 @@ class BatchHandler(GenericHandler):
|
||||||
should (usually) override :meth:`remove_row()` etc.
|
should (usually) override :meth:`remove_row()` etc.
|
||||||
"""
|
"""
|
||||||
batch = row.batch
|
batch = row.batch
|
||||||
|
session = self.app.get_session(batch)
|
||||||
|
|
||||||
self.remove_row(row)
|
self.remove_row(row)
|
||||||
|
|
||||||
|
@ -316,6 +317,7 @@ class BatchHandler(GenericHandler):
|
||||||
batch.row_count -= 1
|
batch.row_count -= 1
|
||||||
|
|
||||||
self.refresh_batch_status(batch)
|
self.refresh_batch_status(batch)
|
||||||
|
session.flush()
|
||||||
|
|
||||||
def remove_row(self, row):
|
def remove_row(self, row):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue