diff options
| author | Ipakeev <23178128+ipakeev@users.noreply.github.com> | 2022-07-04 07:37:36 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-04 06:37:36 +0200 |
| commit | 425718726b7d2edd7b8a043f8976e437262b5098 (patch) | |
| tree | 62e14cdf2353bcd26776bed0f8951ba04e72341a /django/db/models/sql/query.py | |
| parent | 5eb6a2b33d70b9889e1cafa12594ad6f80773d3a (diff) | |
Fixed #33816 -- Fixed QuerySet.only() after select_related() crash on proxy models.
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 33cc636b22..cf7566d771 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -748,6 +748,7 @@ class Query(BaseExpression): cur_model = source.related_model else: cur_model = source.remote_field.model + cur_model = cur_model._meta.concrete_model opts = cur_model._meta # Even if we're "just passing through" this model, we must add # both the current model's pk and the related reference field |
