Fix error: get mab using customer and not email

This commit is contained in:
PCoder 2019-04-04 07:59:38 +02:00
parent 8dfee2bd83
commit a59cd86fee
1 changed files with 3 additions and 1 deletions

View File

@ -84,7 +84,9 @@ class DashboardView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
context = self.get_context_data()
try:
MonthlyHostingBill.objects.get(email=self.request.user.email)
MonthlyHostingBill.objects.get(
customer=self.request.user.stripecustomer
)
context['has_invoices'] = True
except MonthlyHostingBill.DoesNotExist as dne:
logger.error("{}'s monthly hosting bill not imported ?".format(