From 0c39336653c12e4adb8831f3deef2612f4e59375 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 22 Jun 2020 20:04:01 +0530 Subject: [PATCH] Sort invoices by created_at desc --- hosting/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 65e6cc70..438a0d55 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1313,7 +1313,7 @@ class InvoiceListView(LoginRequiredMixin, TemplateView): hosting_orders = HostingOrder.objects.filter( customer=cu.stripecustomer).filter( Q(subscription_id=None) | Q(subscription_id='') - ) + ).order_by('-created_at') stripe_chgs = [] for ho in hosting_orders: stripe_chgs.append({ho.id: stripe.Charge.retrieve(ho.stripe_charge_id)}) @@ -1341,7 +1341,7 @@ class InvoiceListView(LoginRequiredMixin, TemplateView): hosting_orders = HostingOrder.objects.filter( customer=self.request.user.stripecustomer).filter( Q(subscription_id=None) | Q(subscription_id='') - ) + ).order_by('-created_at') stripe_chgs = [] for ho in hosting_orders: stripe_chgs.append(