From 339f3c6361cc112601f5486d7d3f6f0e60044859 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 20 Nov 2016 16:03:28 -0600 Subject: [PATCH] Move `get_batch_kwargs()` to `BatchMasterView` --- tailbone/views/batch.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tailbone/views/batch.py b/tailbone/views/batch.py index 2e6b8529..3b7faa1c 100644 --- a/tailbone/views/batch.py +++ b/tailbone/views/batch.py @@ -265,6 +265,20 @@ class BatchMasterView(MasterView): # return this object to replace the original return batch + def get_batch_kwargs(self, batch): + """ + Return a kwargs dict for use with ``self.handler.make_batch()``, using + the given batch as a template. + """ + kwargs = {} + if batch.created_by: + kwargs['created_by'] = batch.created_by + elif batch.created_by_uuid: + kwargs['created_by_uuid'] = batch.created_by_uuid + if hasattr(batch, 'filename'): + kwargs['filename'] = batch.filename + return kwargs + def init_batch(self, batch): """ Initialize a new batch. Derived classes can override this to @@ -925,20 +939,6 @@ class FileBatchMasterView(BatchMasterView): fs.filename, ]) - def get_batch_kwargs(self, batch): - """ - Return a kwargs dict for use with ``self.handler.make_batch()``, using - the given batch as a template. - """ - kwargs = {} - if batch.created_by: - kwargs['created_by'] = batch.created_by - elif batch.created_by_uuid: - kwargs['created_by_uuid'] = batch.created_by_uuid - if hasattr(batch, 'filename'): - kwargs['filename'] = batch.filename - return kwargs - def download(self): """ View for downloading the data file associated with a batch.