From ba75492dcc4b5729a3e5192d066ba3d5559e3018 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Sat, 22 Feb 2025 01:02:35 -0300 Subject: [PATCH] fix(insights:latest-transactions): order transactions from newest to oldest --- app/apps/insights/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/apps/insights/views.py b/app/apps/insights/views.py index 3141873..94c134b 100644 --- a/app/apps/insights/views.py +++ b/app/apps/insights/views.py @@ -164,7 +164,9 @@ def category_sum_by_currency(request): @require_http_methods(["GET"]) def latest_transactions(request): limit = timezone.now() - relativedelta(days=3) - transactions = Transaction.objects.filter(created_at__gte=limit)[:30] + transactions = Transaction.objects.filter(created_at__gte=limit).order_by("-id")[ + :30 + ] return render( request,