Fixed #28811 -- Fixed crash when combining regular and group by annotations.

This commit is contained in:
Robin Ramael 2018-01-03 11:57:18 +01:00 committed by Tim Graham
parent 2cb6b7732d
commit fbf647287e
2 changed files with 19 additions and 1 deletions

View file

@ -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)