From 297ca3fe1145561803a7eaabf471243912dc24a1 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 20 Mar 2020 14:58:29 -0500 Subject: [PATCH] Fix default row grid config logic for batches make sure we don't overwrite configured row labels --- tailbone/views/batch/core.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 7afc4dbd..9f992bf8 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -583,22 +583,20 @@ class BatchMasterView(MasterView): def configure_row_grid(self, g): super(BatchMasterView, self).configure_row_grid(g) + g.set_sort_defaults('sequence') + g.set_link('sequence') + g.set_label('sequence', "Seq.") + if 'sequence' in g.filters: + g.filters['sequence'].label = "Sequence" + if 'status_code' in g.filters: g.filters['status_code'].set_value_renderer(grids.filters.EnumValueRenderer(self.model_row_class.STATUS)) - g.set_sort_defaults('sequence') - if self.model_row_class: g.set_enum('status_code', self.model_row_class.STATUS) g.set_renderer('status_code', self.render_row_status) - g.set_label('sequence', "Seq.") - g.set_label('status_code', "Status") - g.set_label('item_id', "Item ID") - - g.set_link('sequence') - def get_row_status_enum(self): return self.model_row_class.STATUS