Propagates the per_user_limit category error to the products, rather than the category.
Fixes #79.
This commit is contained in:
		
							parent
							
								
									3903d2be56
								
							
						
					
					
						commit
						1c239c361f
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		|  | @ -205,12 +205,11 @@ class CartController(object): | |||
|             to_add = sum(i[1] for i in by_cat[category]) | ||||
| 
 | ||||
|             if to_add > limit: | ||||
|                 errors.append(( | ||||
|                     category, | ||||
|                     "You may only have %d items in category: %s" % ( | ||||
|                 message = "You may only have %d items in category: %s" % ( | ||||
|                     limit, category.name, | ||||
|                 ) | ||||
|                 )) | ||||
|                 for product, quantity in by_cat[category]: | ||||
|                     errors.append((product, message)) | ||||
| 
 | ||||
|         # Test the flag conditions | ||||
|         errs = FlagController.test_flags( | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer