Check if user has stripecustomer attr
This commit is contained in:
		
					parent
					
						
							
								92b2504f1e
							
						
					
				
			
			
				commit
				
					
						8c04acaff8
					
				
			
		
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
					@ -85,6 +85,8 @@ class DashboardView(LoginRequiredMixin, View):
 | 
				
			||||||
        context = self.get_context_data()
 | 
					        context = self.get_context_data()
 | 
				
			||||||
        context['has_invoices'] = False
 | 
					        context['has_invoices'] = False
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
 | 
					            bills = []
 | 
				
			||||||
 | 
					            if hasattr(self.request.user, 'stripecustomer'):
 | 
				
			||||||
                bills = MonthlyHostingBill.objects.filter(
 | 
					                bills = MonthlyHostingBill.objects.filter(
 | 
				
			||||||
                    customer=self.request.user.stripecustomer
 | 
					                    customer=self.request.user.stripecustomer
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue