add batch provider restriction config
This commit is contained in:
parent
4f45aa9118
commit
a14bebabc7
|
@ -268,7 +268,15 @@ class CreateProductsBatch(ProductsGrid):
|
||||||
}
|
}
|
||||||
return render_to_response('/progress.mako', kwargs, request=self.request)
|
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}
|
return {'providers': providers}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue