From 67da60b5b0b700985bb0ad353493d41ae91fbb3a Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Sun, 16 Feb 2025 19:33:58 -0300 Subject: [PATCH] fix(insights:category-explorer): use currency name instead of code --- app/apps/insights/utils/category_explorer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/apps/insights/utils/category_explorer.py b/app/apps/insights/utils/category_explorer.py index 1f74070..639750c 100644 --- a/app/apps/insights/utils/category_explorer.py +++ b/app/apps/insights/utils/category_explorer.py @@ -58,7 +58,7 @@ def get_category_sums_by_currency(queryset, category): """ sums = ( queryset.filter(category=category) - .values("account__currency__code") + .values("account__currency__name") .annotate( income=Coalesce( Sum( @@ -83,11 +83,11 @@ def get_category_sums_by_currency(queryset, category): output_field=DecimalField(max_digits=42, decimal_places=30), ), ) - .order_by("account__currency__code") + .order_by("account__currency__name") ) return { - "labels": [item["account__currency__code"] for item in sums], + "labels": [item["account__currency__name"] for item in sums], "datasets": [ { "label": _("Income"),