#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: (none)
Type: Bug | Status: new
Component: Core (System checks) | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Hal Blackburn):
You're welcome! Sure, I'd be happy to make a patch.
Good idea to skip these checks for proxy models. Shall we return early
from `_check_composite_pk()`
[https://github.com/django/django/blob/05ba1a9228128614fb3c475f1c4bdf0160f44dba/django/db/models/base.py#L1804-L1805
at this point] that `if not isinstance(pk, CompositePrimaryKey):` also
returns early?
--
Ticket URL: <https://code.djangoproject.com/ticket/36704#comment:2>
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/0107019a495f065d-c6164014-d017-47a6-ae77-c81db0608248-000000%40eu-central-1.amazonses.com.