Check invoice list from stripe only if we have a stripecustomer
This commit is contained in:
parent
e25ed77538
commit
56d3d4e7fe
|
@ -1297,7 +1297,7 @@ class InvoiceListView(LoginRequiredMixin, TemplateView):
|
||||||
except CustomUser.DoesNotExist as dne:
|
except CustomUser.DoesNotExist as dne:
|
||||||
logger.debug("User does not exist")
|
logger.debug("User does not exist")
|
||||||
cu = self.request.user
|
cu = self.request.user
|
||||||
if cu.stripecustomer:
|
if hasattr(cu, 'stripecustomer'):
|
||||||
invs = stripe.Invoice.list(customer=cu.stripecustomer.stripe_id,
|
invs = stripe.Invoice.list(customer=cu.stripecustomer.stripe_id,
|
||||||
count=100)
|
count=100)
|
||||||
else:
|
else:
|
||||||
|
@ -1311,7 +1311,7 @@ class InvoiceListView(LoginRequiredMixin, TemplateView):
|
||||||
invs_page = paginator.page(paginator.num_pages)
|
invs_page = paginator.page(paginator.num_pages)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
if self.request.user.stripecustomer:
|
if hasattr(self.request.user, "stripecustomer"):
|
||||||
invs = stripe.Invoice.list(
|
invs = stripe.Invoice.list(
|
||||||
customer=self.request.user.stripecustomer.stripe_id,
|
customer=self.request.user.stripecustomer.stripe_id,
|
||||||
count=100
|
count=100
|
||||||
|
|
Loading…
Reference in New Issue