add batch provider restriction config
This commit is contained in:
		
							parent
							
								
									4f45aa9118
								
							
						
					
					
						commit
						a14bebabc7
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar