diff --git a/hosting/views.py b/hosting/views.py index bffaa072..0cf555f2 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1297,7 +1297,7 @@ class InvoiceListView(LoginRequiredMixin, TemplateView): except CustomUser.DoesNotExist as dne: logger.debug("User does not exist") cu = self.request.user - if cu.stripecustomer: + if hasattr(cu, 'stripecustomer'): invs = stripe.Invoice.list(customer=cu.stripecustomer.stripe_id, count=100) else: @@ -1311,7 +1311,7 @@ class InvoiceListView(LoginRequiredMixin, TemplateView): invs_page = paginator.page(paginator.num_pages) else: try: - if self.request.user.stripecustomer: + if hasattr(self.request.user, "stripecustomer"): invs = stripe.Invoice.list( customer=self.request.user.stripecustomer.stripe_id, count=100