From 90784cecb2bba64008c9d4c6ad01c81c143409a3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 2 Jan 2026 19:23:57 -0600 Subject: [PATCH] fix: only show "create row" button if batch view supports it --- src/wuttaweb/views/batch.py | 2 +- tests/views/test_batch.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wuttaweb/views/batch.py b/src/wuttaweb/views/batch.py index 0f028cf..89ffe6f 100644 --- a/src/wuttaweb/views/batch.py +++ b/src/wuttaweb/views/batch.py @@ -445,7 +445,7 @@ class BatchMasterView(MasterView): g.set_renderer("status_code", self.render_row_status) # tool button - create row - if not batch.executed and self.has_perm("create_row"): + if self.rows_creatable and not batch.executed and self.has_perm("create_row"): button = self.make_button( f"New {self.get_row_model_title()}", primary=True, diff --git a/tests/views/test_batch.py b/tests/views/test_batch.py index 92c0a4b..317f731 100644 --- a/tests/views/test_batch.py +++ b/tests/views/test_batch.py @@ -442,6 +442,7 @@ class TestBatchMasterView(WebTestCase): mod.BatchMasterView, model_class=MockBatch, route_prefix="mock_batches", + rows_creatable=True, create=True, ): with patch.object(