From a59cd86fee87db3e63db1b33544d8af4d40dc60e Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 4 Apr 2019 07:59:38 +0200 Subject: [PATCH] Fix error: get mab using customer and not email --- hosting/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 6cdabecf..45fd845f 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -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(