diff options
| author | Francesco Panico <francesco.panico@fiscozen.it> | 2023-08-10 14:08:11 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-08-11 08:51:29 +0200 |
| commit | 1506f498fe42b65730ece809300c2c0963e38c5a (patch) | |
| tree | 8c83a06a590e73a4ae88f8cdc43bfa8f1c8f2edc /django/db/models/sql/query.py | |
| parent | 9946f0b0d9356b55e819f861b31615fa5b548f99 (diff) | |
Fixed #34743 -- Fixed Meta.constraints validation crash when using pk.
Thanks Nwawel A Iroume for the report.
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 9853919482..6a9348af66 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1670,7 +1670,7 @@ class Query(BaseExpression): path, names_with_path = [], [] for pos, name in enumerate(names): cur_names_with_path = (name, []) - if name == "pk": + if name == "pk" and opts is not None: name = opts.pk.name field = None |
