Fix error: get mab using customer and not email
This commit is contained in:
		
					parent
					
						
							
								8dfee2bd83
							
						
					
				
			
			
				commit
				
					
						a59cd86fee
					
				
			
		
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -84,7 +84,9 @@ class DashboardView(LoginRequiredMixin, View): | ||||||
|     def get(self, request, *args, **kwargs): |     def get(self, request, *args, **kwargs): | ||||||
|         context = self.get_context_data() |         context = self.get_context_data() | ||||||
|         try: |         try: | ||||||
|             MonthlyHostingBill.objects.get(email=self.request.user.email) |             MonthlyHostingBill.objects.get( | ||||||
|  |                 customer=self.request.user.stripecustomer | ||||||
|  |             ) | ||||||
|             context['has_invoices'] = True |             context['has_invoices'] = True | ||||||
|         except MonthlyHostingBill.DoesNotExist as dne: |         except MonthlyHostingBill.DoesNotExist as dne: | ||||||
|             logger.error("{}'s monthly hosting bill not imported ?".format( |             logger.error("{}'s monthly hosting bill not imported ?".format( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue