From 68d9279dc41624d59d3154b68caf983d4d1043eb Mon Sep 17 00:00:00 2001 From: George Katsikas <giorgakis.katsikas@gmail.com> Date: Fri, 24 Jan 2025 15:37:49 +0100 Subject: [PATCH] =?UTF-8?q?fix(graphs):=20=F0=9F=90=9B=20remove=20null=20a?= =?UTF-8?q?ggragation=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes incorrect count of groups due to multi-exclusion query --- scipost_django/graphs/graphs/plotkind.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scipost_django/graphs/graphs/plotkind.py b/scipost_django/graphs/graphs/plotkind.py index 691034818..d90c37b84 100644 --- a/scipost_django/graphs/graphs/plotkind.py +++ b/scipost_django/graphs/graphs/plotkind.py @@ -442,7 +442,7 @@ class BarPlot(PlotKind): self.plotter.get_queryset() .values(group_key) .annotate(agg=agg_func) - .exclude(Q(**{group_key: None}) | Q(agg=None)) + .exclude(**{group_key: None}) ) if (order_by := self.options.get("order_by")) and ( -- GitLab