Use shared logic to get batch handler

This commit is contained in:
Lance Edgar 2023-11-01 19:43:46 -05:00
parent b231c194a4
commit b13fc99e95

View file

@ -66,9 +66,7 @@ class APIBatchMixin(object):
""" """
app = self.get_rattail_app() app = self.get_rattail_app()
key = self.get_batch_class().batch_key key = self.get_batch_class().batch_key
spec = self.rattail_config.get('rattail.batch', '{}.handler'.format(key), return app.get_batch_handler(key, default=self.default_handler_spec)
default=self.default_handler_spec)
return app.load_object(spec)(self.rattail_config)
class APIBatchView(APIBatchMixin, APIMasterView): class APIBatchView(APIBatchMixin, APIMasterView):