diff options
| author | Simon Charette <charette.s@gmail.com> | 2025-01-13 13:53:57 -0500 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-01-14 16:21:19 +0100 |
| commit | 4bfec242b488b174f7d386ab5bbd3363751cdb93 (patch) | |
| tree | 20a92f0b4695b34feddb273bab28e6c72069836a /django | |
| parent | e580926d74f4d5788feac05ac1d50626936631d7 (diff) | |
Fixed #36093 -- Adjusted unique checks to account for inherited primary keys.
Regression in bf7b17d16d3978b2e1cee4a0f7ce8840bd1a8dc4 refs #36075.
Thanks Sage Abdullah for the report and tests.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index a4d5a0d553..0f07d235a9 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1493,7 +1493,7 @@ class Model(AltersData, metaclass=ModelBase): ): # no value, skip the lookup continue - if f in self._meta.pk_fields and not self._state.adding: + if f in model_class._meta.pk_fields and not self._state.adding: # no need to check for unique primary key when editing continue lookup_kwargs[str(field_name)] = lookup_value |
