Get the last user billing address as the default address
This commit is contained in:
		
					parent
					
						
							
								7423a80670
							
						
					
				
			
			
				commit
				
					
						6ac6db8212
					
				
			
		
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -621,6 +621,7 @@ class SettingsView(LoginRequiredMixin, FormView):
 | 
			
		|||
        form = self.get_form()
 | 
			
		||||
        if form.is_valid():
 | 
			
		||||
            if 'billing-form' in request.POST:
 | 
			
		||||
                current_billing_address = self.request.user.billing_addresses.last()
 | 
			
		||||
                billing_address_data = form.cleaned_data
 | 
			
		||||
                billing_address_data.update({
 | 
			
		||||
                    'user': self.request.user.id
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue