From 5cbccb175a7cec23257cea2f34756f6e21ea378b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 9 Jul 2015 15:45:54 -0500 Subject: [PATCH] Only check executability of a batch when not creating one. There is no batch yet when creating, so execution is not relevant. --- tailbone/views/batch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tailbone/views/batch.py b/tailbone/views/batch.py index 7d9face6..99f84fab 100644 --- a/tailbone/views/batch.py +++ b/tailbone/views/batch.py @@ -468,15 +468,17 @@ class BatchCrud(BaseCrud): """ batch = form.fieldset.model batch.refreshable = self.refreshable - return { + kwargs = { 'batch': batch, 'batch_display': self.batch_display, 'batch_display_plural': self.batch_display_plural, 'execute_title': self.handler.get_execute_title(batch), - 'execute_enabled': self.executable(batch), 'route_prefix': self.route_prefix, 'permission_prefix': self.permission_prefix, } + if not self.creating: + kwargs['execute_enabled'] = self.executable(batch) + return kwargs def executable(self, batch): return self.handler.executable(batch)