From 26c6c083c4b7992e009e1f3289a62d1cbc85470f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 16 Oct 2016 03:33:10 -0500 Subject: [PATCH] Add `refresh_after_create` flag for `BatchMasterView` Hopefully this is a good idea too.. --- tailbone/views/batch.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tailbone/views/batch.py b/tailbone/views/batch.py index 10085602..4e726a00 100644 --- a/tailbone/views/batch.py +++ b/tailbone/views/batch.py @@ -67,6 +67,7 @@ class BatchMasterView(MasterView): rows_deletable = True rows_downloadable = True refreshable = True + refresh_after_create = False def __init__(self, request): super(BatchMasterView, self).__init__(request) @@ -273,6 +274,11 @@ class BatchMasterView(MasterView): """ return True + def redirect_after_create(self, batch): + if self.refresh_after_create: + return self.redirect(self.get_action_url('refresh', batch)) + return super(BatchMasterView, self).redirect_after_create(batch) + # TODO: some of this at least can go to master now right? def edit(self): """