Let batch handler determine whether Execute button is enabled.
This commit is contained in:
parent
4290f0d8df
commit
dc1ef65441
|
@ -473,11 +473,14 @@ class BatchCrud(BaseCrud):
|
||||||
'batch_display': self.batch_display,
|
'batch_display': self.batch_display,
|
||||||
'batch_display_plural': self.batch_display_plural,
|
'batch_display_plural': self.batch_display_plural,
|
||||||
'execute_title': self.handler.get_execute_title(batch),
|
'execute_title': self.handler.get_execute_title(batch),
|
||||||
'execute_enabled': True,
|
'execute_enabled': self.executable(batch),
|
||||||
'route_prefix': self.route_prefix,
|
'route_prefix': self.route_prefix,
|
||||||
'permission_prefix': self.permission_prefix,
|
'permission_prefix': self.permission_prefix,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def executable(self, batch):
|
||||||
|
return self.handler.executable(batch)
|
||||||
|
|
||||||
def flash_create(self, batch):
|
def flash_create(self, batch):
|
||||||
if 'create' in self.flash:
|
if 'create' in self.flash:
|
||||||
self.request.session.flash(self.flash['create'])
|
self.request.session.flash(self.flash['create'])
|
||||||
|
|
Loading…
Reference in a new issue