Skip to content

Commit

Permalink
[1.8.x] Fixed a query failure on Python 3.5; refs #23763.
Browse files Browse the repository at this point in the history
The failure was introduced in Django by
c7fd9b2 and the change in
Python 3.5 is https://hg.python.org/cpython/rev/a3c345ba3563.

Backport of be1357e from master
  • Loading branch information
timgraham committed Jan 20, 2015
1 parent c80b214 commit cb90d48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/db/models/sql/query.py
Expand Up @@ -402,7 +402,7 @@ def get_aggregation(self, using, added_aggregate_names):
# Remove any aggregates marked for reduction from the subquery # Remove any aggregates marked for reduction from the subquery
# and move them to the outer AggregateQuery. # and move them to the outer AggregateQuery.
col_cnt = 0 col_cnt = 0
for alias, expression in inner_query.annotation_select.items(): for alias, expression in list(inner_query.annotation_select.items()):
if expression.is_summary: if expression.is_summary:
expression, col_cnt = inner_query.rewrite_cols(expression, col_cnt) expression, col_cnt = inner_query.rewrite_cols(expression, col_cnt)
outer_query.annotations[alias] = expression.relabeled_clone(relabels) outer_query.annotations[alias] = expression.relabeled_clone(relabels)
Expand Down

0 comments on commit cb90d48

Please sign in to comment.