From fbf647287ebd9898bff69c65a89fa09a903adaa5 Mon Sep 17 00:00:00 2001 From: Robin Ramael Date: Wed, 3 Jan 2018 11:57:18 +0100 Subject: Fixed #28811 -- Fixed crash when combining regular and group by annotations. --- django/db/models/sql/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 7c88144fd2..bfee2256e6 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1514,7 +1514,7 @@ class Query: # that case we need to return a Ref to the subquery's annotation. return Ref(name, self.annotation_select[name]) else: - return self.annotation_select[name] + return self.annotations[name] else: field_list = name.split(LOOKUP_SEP) join_info = self.setup_joins(field_list, self.get_meta(), self.get_initial_alias(), can_reuse=reuse) -- cgit v1.3