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 a2af672546..70177667a6 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1338,6 +1338,8 @@ class QuerySet(AltersData):
self._not_support_combined_queries("update")
if self.query.is_sliced:
raise TypeError("Cannot update a query once a slice has been taken.")
+ if self.query.distinct_fields:
+ raise TypeError("Cannot call update() after .distinct(*fields).")
self._for_write = True
query = self.query.chain(sql.UpdateQuery)
query.add_update_values(kwargs)