add batch provider restriction config

This commit is contained in:
Lance Edgar 2012-09-25 09:42:52 -07:00
parent 4f45aa9118
commit a14bebabc7

View file

@ -268,7 +268,15 @@ class CreateProductsBatch(ProductsGrid):
}
return render_to_response('/progress.mako', kwargs, request=self.request)
providers = [(x.name, x.description) for x in batches.iter_providers()]
enabled = edbob.config.get('rattail.pyramid', 'batches.providers')
if enabled:
enabled = enabled.split()
providers = []
for provider in batches.iter_providers():
if not enabled or provider.name in enabled:
providers.append((provider.name, provider.description))
return {'providers': providers}