summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2019-01-21 08:24:32 -0600
committerTim Graham <timograham@gmail.com>2019-01-21 09:24:47 -0500
commit6516e49262546238d02f6ca37b74ee0e67dead0a (patch)
tree1fa4892a126e58025dbbfeb9a1e8a2de67022a73 /django/db
parent370371ee9e0b2f47fa9735310c3a784714c61291 (diff)
[2.2.x] Fixed #30120 -- Fixed invalid SQL in distinct aggregate.
Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111 (refs #28658). Backport of 65858119d23e37872505a4476e7141c33981fb50 from master.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/models/aggregates.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/aggregates.py b/django/db/models/aggregates.py
index ac0b62d0bf..ea88c54b0d 100644
--- a/django/db/models/aggregates.py
+++ b/django/db/models/aggregates.py
@@ -68,7 +68,7 @@ class Aggregate(Func):
return []
def as_sql(self, compiler, connection, **extra_context):
- extra_context['distinct'] = 'DISTINCT' if self.distinct else ''
+ extra_context['distinct'] = 'DISTINCT ' if self.distinct else ''
if self.filter:
if connection.features.supports_aggregate_filter_clause:
filter_sql, filter_params = self.filter.as_sql(compiler, connection)