summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-11-20 14:18:47 -0500
committerSimon Charette <charette.s@gmail.com>2015-11-22 23:12:31 -0500
commiteb7a329fb65e93dcd6c773c167353af9825d7b6e (patch)
treea69cd46fb762b455b58e84ff05b0f1dc8d314d4b /django
parentc598dfa84a9363d38b020e544ea2fd5657f912b2 (diff)
[1.9.x] Fixed #25685 -- Fixed a duplicate query regression on deletion of proxied models.
Thanks to Trac alias ppetrid for the report and Tim for the review. Conflicts: tests/delete/tests.py Forward port of 7c3ef19978b36b61db88a519f799f1ce8d019679 from stable/1.8.x
Diffstat (limited to 'django')
-rw-r--r--django/db/models/deletion.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
index a8c98f5b83..e067559ccb 100644
--- a/django/db/models/deletion.py
+++ b/django/db/models/deletion.py
@@ -58,9 +58,9 @@ def get_candidate_relations_to_delete(opts):
candidate_models = {opts}
candidate_models = candidate_models.union(opts.concrete_model._meta.proxied_children)
# For each model, get all candidate fields.
- candidate_model_fields = chain.from_iterable(
+ candidate_model_fields = set(chain.from_iterable(
opts.get_fields(include_hidden=True) for opts in candidate_models
- )
+ ))
# The candidate relations are the ones that come from N-1 and 1-1 relations.
# N-N (i.e., many-to-many) relations aren't candidates for deletion.
return (