Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2b92a3670 | ||
| eda887f82c | |||
|
|
56d3d4e7fe | ||
|
|
e25ed77538 | ||
|
|
d0455fbafb |
3 changed files with 17 additions and 9 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
2.10.3: 2020-02-25
|
||||||
|
* Handle 500 error in invoice list page for non-stripe users (MR!731)
|
||||||
2.10.2: 2020-02-04
|
2.10.2: 2020-02-04
|
||||||
* Introduce base price for VMs and let admins add stripe_coupon_id (MR!730)
|
* Introduce base price for VMs and let admins add stripe_coupon_id (MR!730)
|
||||||
Notes for deployment:
|
Notes for deployment:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ from utils.forms import (
|
||||||
)
|
)
|
||||||
from utils.hosting_utils import (
|
from utils.hosting_utils import (
|
||||||
get_vm_price_with_vat, get_all_public_keys, get_vat_rate_for_country,
|
get_vm_price_with_vat, get_all_public_keys, get_vat_rate_for_country,
|
||||||
get_vm_price_for_given_vat, round_up
|
get_vm_price_for_given_vat
|
||||||
)
|
)
|
||||||
from utils.stripe_utils import StripeUtils
|
from utils.stripe_utils import StripeUtils
|
||||||
from utils.tasks import send_plain_email_task
|
from utils.tasks import send_plain_email_task
|
||||||
|
|
|
||||||
|
|
@ -1297,9 +1297,12 @@ 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
|
||||||
invs = stripe.Invoice.list(customer=cu.stripecustomer.stripe_id,
|
if hasattr(cu, 'stripecustomer'):
|
||||||
count=100)
|
invs = stripe.Invoice.list(customer=cu.stripecustomer.stripe_id,
|
||||||
paginator = Paginator(invs.data, 10)
|
count=100)
|
||||||
|
else:
|
||||||
|
invs = []
|
||||||
|
paginator = Paginator(invs.data if len(invs) > 0 else [], 10)
|
||||||
try:
|
try:
|
||||||
invs_page = paginator.page(page)
|
invs_page = paginator.page(page)
|
||||||
except PageNotAnInteger:
|
except PageNotAnInteger:
|
||||||
|
|
@ -1308,11 +1311,14 @@ class InvoiceListView(LoginRequiredMixin, TemplateView):
|
||||||
invs_page = paginator.page(paginator.num_pages)
|
invs_page = paginator.page(paginator.num_pages)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
invs = stripe.Invoice.list(
|
if hasattr(self.request.user, "stripecustomer"):
|
||||||
customer=self.request.user.stripecustomer.stripe_id,
|
invs = stripe.Invoice.list(
|
||||||
count=100
|
customer=self.request.user.stripecustomer.stripe_id,
|
||||||
)
|
count=100
|
||||||
paginator = Paginator(invs.data, 10)
|
)
|
||||||
|
else:
|
||||||
|
invs = []
|
||||||
|
paginator = Paginator(invs.data if len(invs) > 0 else [], 10)
|
||||||
try:
|
try:
|
||||||
invs_page = paginator.page(page)
|
invs_page = paginator.page(page)
|
||||||
except PageNotAnInteger:
|
except PageNotAnInteger:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue