From 0f7f21380eabcf5e1e4197a9ff0ac2083c36519e Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 3 Mar 2022 19:33:15 +0100 Subject: [PATCH] feat(api): custom_metrics fixed group elements --- api/chalicelib/core/custom_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index e045dbbb6..06a2c328b 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -36,7 +36,7 @@ def __try_live(project_id, data: schemas.CreateCustomMetricsSchema): results[i]["values"] = results[i]["values"][:PIE_CHART_GROUP] \ + [{ "name": "Others", "group": True, - "sessionCount": sum(r["sessionCount"] for r in results[i][PIE_CHART_GROUP:]) + "sessionCount": sum(r["sessionCount"] for r in results[i]["values"][PIE_CHART_GROUP:]) }] return results