From 242bcd7603ee0de091fa77b5df82a0439fa062cc Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 18 May 2017 11:57:30 -0500 Subject: [PATCH] Remove references to deprecated batch handler methods --- tailbone/views/batch/core.py | 4 ++-- tailbone/views/products.py | 2 +- tailbone/views/purchases/batch.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 3ca566d3..dce333bb 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -306,7 +306,7 @@ class BatchMasterView(MasterView): return True def redirect_after_create(self, batch): - if self.handler.requires_prefill(batch): + if self.handler.should_populate(batch): return self.redirect(self.get_action_url('prefill', batch)) elif self.refresh_after_create: return self.redirect(self.get_action_url('refresh', batch)) @@ -501,7 +501,7 @@ class BatchMasterView(MasterView): session = RattailSession() batch = session.query(self.model_class).get(batch_uuid) try: - self.handler.make_initial_rows(batch, progress=progress) + self.handler.populate(batch, progress=progress) except Exception as error: session.rollback() log.warning("batch pre-fill failed: {}".format(batch), exc_info=True) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index b06e8ce9..55b4dfdf 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -494,7 +494,7 @@ class ProductsView(MasterView): params['created_by'] = user batch = handler.make_batch(session, **params) batch.products = products.with_session(session).all() - handler.make_initial_rows(batch, progress=progress) + handler.populate(batch, progress=progress) session.commit() session.refresh(batch) diff --git a/tailbone/views/purchases/batch.py b/tailbone/views/purchases/batch.py index c875239c..df5c9a55 100644 --- a/tailbone/views/purchases/batch.py +++ b/tailbone/views/purchases/batch.py @@ -943,8 +943,8 @@ class PurchaseBatchView(BatchMasterView): batch.created_by = self.request.user kwargs = self.get_batch_kwargs(batch, mobile=True) batch = self.handler.make_batch(self.Session(), **kwargs) - if self.handler.requires_prefill(batch): - self.handler.make_initial_rows(batch) + if self.handler.should_populate(batch): + self.handler.populate(batch) self.request.session.flash("Created new purchasing batch: {}".format(batch)) # TODO: redirect to mobile receiving view etc. instead return self.redirect(self.request.route_url('purchases.batch.mobile_create'))