Fix row query bug when deleting batch row

This commit is contained in:
Lance Edgar 2018-01-11 12:25:25 -06:00
parent 3dce9d9ed3
commit e2cdb4387a

View file

@ -729,15 +729,15 @@ class BatchMasterView(MasterView):
"Delete" a row from the batch. This sets the ``removed`` flag on the "Delete" a row from the batch. This sets the ``removed`` flag on the
row but does not truly delete it. row but does not truly delete it.
""" """
row = self.Session.query(self.model_row_class).get(self.request.matchdict['uuid']) row = self.Session.query(self.model_row_class).get(self.request.matchdict['row_uuid'])
if not row: if not row:
raise httpexceptions.HTTPNotFound() raise httpexceptions.HTTPNotFound()
row.removed = True row.removed = True
batch = row.batch batch = self.get_parent(row)
self.handler.refresh_batch_status(batch) self.handler.refresh_batch_status(batch)
if batch.rowcount is not None: if batch.rowcount is not None:
batch.rowcount -= 1 batch.rowcount -= 1
return self.redirect(self.get_action_url('view', self.get_parent(row))) return self.redirect(self.get_action_url('view', batch))
def bulk_delete_rows(self): def bulk_delete_rows(self):
""" """