mirror of
https://github.com/django/django.git
synced 2025-10-29 16:46:11 +00:00
Fixed #32433 -- Added error message on QuerySet.delete() following distinct().
This commit is contained in:
committed by
Mariusz Felisiak
parent
4e8ecf0cb6
commit
6307c3f1a1
@@ -724,6 +724,8 @@ class QuerySet:
|
||||
assert not self.query.is_sliced, \
|
||||
"Cannot use 'limit' or 'offset' with delete."
|
||||
|
||||
if self.query.distinct or self.query.distinct_fields:
|
||||
raise TypeError('Cannot call delete() after .distinct().')
|
||||
if self._fields is not None:
|
||||
raise TypeError("Cannot call delete() after .values() or .values_list()")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user