From 4e6f0024f19f74be2fe4d9ec637b87e82054ebd6 Mon Sep 17 00:00:00 2001 From: Étienne Beaulé Date: Tue, 4 Jun 2019 04:01:16 -0300 Subject: [2.2.x] Fixed #30542 -- Fixed crash of numerical aggregations with filter. Filters in annotations crashed when used with numerical-type aggregations (i.e. Avg, StdDev, and Variance). This was caused as the source expressions no not necessarily have an output_field (such as the filter field), which lead to an AttributeError: 'WhereNode' object has no attribute output_field. Thanks to Chuan-Zheng Lee for the report. Regression in c690afb873cac8035a3cb3be7c597a5ff0e4b261 and two following commits. Backport of 4b6dfe16226a81fea464ac5f77942f4d6ba266e8 from master. --- docs/releases/2.2.3.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/releases/2.2.3.txt b/docs/releases/2.2.3.txt index 73dba08a83..a42e57c779 100644 --- a/docs/releases/2.2.3.txt +++ b/docs/releases/2.2.3.txt @@ -9,4 +9,6 @@ Django 2.2.3 fixes several bugs in 2.2.2. Bugfixes ======== -* ... +* Fixed a regression in Django 2.2 where :class:`~django.db.models.Avg`, + :class:`~django.db.models.StdDev`, and :class:`~django.db.models.Variance` + crash with ``filter`` argument (:ticket:`30542`). -- cgit v1.3