#36704: Proxy model with a CompositePrimaryKey fails system check with false
positive: (models.E042) '<field>' cannot be included in the composite
primary key
-------------------------------------+-------------------------------------
Reporter: Hal Blackburn | Owner: Hal
| Blackburn
Type: Bug | Status: closed
Component: Core (System | Version: 5.2
checks) |
Severity: Release blocker | Resolution: fixed
Keywords: compositeprimarykey | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):
In [changeset:"12042b8978a686d815636b11b9ea602b7031ae0a" 12042b8]:
{{{#!CommitTicketReference repository=""
revision="12042b8978a686d815636b11b9ea602b7031ae0a"
[6.0.x] Fixed #36704 -- Fixed system check error for proxy model with a
composite pk.
Proxy models subclassing a model with a CompositePrimaryKey were
incorrectly reporting check errors because the check that requires only
local fields to be used in a composite pk was evaluated against the proxy
subclass, which has no fields.
To fix this, composite pk field checks are not evaluated against
proxy subclasses, as none of the checks are applicable to proxy
subclasses. This also has the benefit of not double-reporting real check
errors from an invalid superclass pk.
Thanks Clifford Gama for the review.
Backport of 74564946c3b42a2ef7d087047e49873847a7e1d9 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36704#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019a4fcfcfbd-6821e2ba-f914-4676-8c19-940d7654cbc3-000000%40eu-central-1.amazonses.com.