﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30244	Aggregate functions with filter have bug with state mutation in get_source_expressions() method	Andrey Torsunov	nobody	"Django 2.1.7

{{{
In [27]: s = Sum('x', filter=Q(x=1))

In [28]: s.get_source_expressions()
Out[28]: [F(x), <Q: (AND: ('x', 1))>]

In [29]: s.get_source_expressions()
Out[29]: [F(x), <Q: (AND: ('x', 1))>, <Q: (AND: ('x', 1))>]

In [30]: s.get_source_expressions()
Out[30]: [F(x), <Q: (AND: ('x', 1))>, <Q: (AND: ('x', 1))>, <Q: (AND: ('x', 1))>]
}}}

Each call of `get_source_expressions` on instance of aggregate function causes list element duplication.
"	Bug	closed	Database layer (models, ORM)	2.1	Normal	fixed			Unreviewed	0	0	0	0	0	0
