summaryrefslogtreecommitdiff
path: root/django/db/models/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/query.py')
-rw-r--r--django/db/models/query.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 40f7ae6ea9..4085e618cf 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -632,6 +632,8 @@ class QuerySet(object):
self._for_write = True
query = self.query.clone(sql.UpdateQuery)
query.add_update_values(kwargs)
+ # Clear any annotations so that they won't be present in subqueries.
+ query._annotations = None
with transaction.atomic(using=self.db, savepoint=False):
rows = query.get_compiler(self.db).execute_sql(CURSOR)
self._result_cache = None