+%def>
+
+<%def name="modify_vue_vars()">
+ ${parent.modify_vue_vars()}
+
%def>
diff --git a/src/sideshow/web/views/orders.py b/src/sideshow/web/views/orders.py
index 80c9d24..a48546e 100644
--- a/src/sideshow/web/views/orders.py
+++ b/src/sideshow/web/views/orders.py
@@ -163,7 +163,7 @@ class OrderView(MasterView):
Returns the configured :term:`handler` for :term:`new order
batches `.
- You normally would not need to call this; just use
+ You normally would not need to call this, and can use
:attr:`batch_handler` instead.
:returns:
@@ -172,9 +172,7 @@ class OrderView(MasterView):
"""
if hasattr(self, 'batch_handler'):
return self.batch_handler
-
- # TODO
- return NewOrderBatchHandler(self.config)
+ return self.app.get_batch_handler('neworder')
def create(self):
"""
@@ -863,6 +861,9 @@ class OrderView(MasterView):
""" """
settings = [
+ # batches
+ {'name': 'wutta.batch.neworder.handler.spec'},
+
# customers
{'name': 'sideshow.orders.use_local_customers',
# nb. this is really a bool but we present as string in config UI
@@ -895,6 +896,10 @@ class OrderView(MasterView):
context['pending_product_fields'] = self.PENDING_PRODUCT_ENTRY_FIELDS
+ handlers = self.app.get_batch_handler_specs('neworder')
+ handlers = [{'spec': spec} for spec in handlers]
+ context['batch_handlers'] = handlers
+
return context
@classmethod
diff --git a/tests/web/views/test_orders.py b/tests/web/views/test_orders.py
index 278c674..98d00cd 100644
--- a/tests/web/views/test_orders.py
+++ b/tests/web/views/test_orders.py
@@ -42,6 +42,8 @@ class TestOrderView(WebTestCase):
def test_create(self):
self.pyramid_config.include('sideshow.web.views')
+ self.config.setdefault('wutta.batch.neworder.handler.spec',
+ 'sideshow.batch.neworder:NewOrderBatchHandler')
model = self.app.model
enum = self.app.enum
view = self.make_view()