Fix batch row count when bulk-deleting rows

This commit is contained in:
Lance Edgar 2017-12-02 13:24:38 -06:00
parent 9cf5c9385d
commit 11a63ab2ef

View file

@ -738,9 +738,11 @@ class BatchMasterView(MasterView):
"Delete" all rows matching the current row grid view query. This sets
the ``removed`` flag on the rows but does not truly delete them.
"""
batch = self.get_instance()
query = self.get_effective_row_data(sort=False)
batch.rowcount -= query.count()
query.update({'removed': True}, synchronize_session=False)
return self.redirect(self.get_action_url('view', self.get_instance()))
return self.redirect(self.get_action_url('view', batch))
def execute(self):
"""