Fixes issues on /amend
This commit is contained in:
		
							parent
							
								
									9dd31128bb
								
							
						
					
					
						commit
						3903d2be56
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -851,10 +851,13 @@ def amend_registration(request, user_id): | |||
|             for ve_field in ve.error_list: | ||||
|                 product, message = ve_field.message | ||||
|                 for form in formset: | ||||
|                     if "product" not in form.cleaned_data: | ||||
|                         # This is the empty form. | ||||
|                         continue | ||||
|                     if form.cleaned_data["product"] == product: | ||||
|                         form.add_error("quantity", message) | ||||
| 
 | ||||
|     if request.POST and voucher_form.is_valid(): | ||||
|     if request.POST and voucher_form.has_changed() and voucher_form.is_valid(): | ||||
|         try: | ||||
|             current_cart.apply_voucher(voucher_form.cleaned_data["voucher"]) | ||||
|             return redirect(amend_registration, user_id) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer