Add initial value for the vat_number field in the settings
This commit is contained in:
		
					parent
					
						
							
								5e97d70a5e
							
						
					
				
			
			
				commit
				
					
						568d874476
					
				
			
		
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -538,9 +538,12 @@ class SettingsView(LoginRequiredMixin, FormView):
 | 
			
		|||
        Check if the user already saved contact details. If so, then show
 | 
			
		||||
        the form populated with those details, to let user change them.
 | 
			
		||||
        """
 | 
			
		||||
        return form_class(
 | 
			
		||||
 | 
			
		||||
        bill_form = form_class(
 | 
			
		||||
            instance=self.request.user.billing_addresses.first(),
 | 
			
		||||
            **self.get_form_kwargs())
 | 
			
		||||
        bill_form.fields['vat_number'].initial = self.request.user.vat_number
 | 
			
		||||
        return bill_form
 | 
			
		||||
 | 
			
		||||
    def get_context_data(self, **kwargs):
 | 
			
		||||
        context = super(SettingsView, self).get_context_data(**kwargs)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue