-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #11335: Default manager for ObjectChange should filter by installed apps #11709
Conversation
Posting my slack message here as well for posterity:
|
We're probably breaking some Django rules by attempting to evaluate registered apps within the model's base manager. A compromise might be to introduce an alternate manager that returns only the "valid" instances (e.g. |
b0c32ea
to
167e851
Compare
Although the current approach appears to resolve the root issue, it causes the tests to fail, presumably because we're attempting to resolve the content types too early. There may be a way to resole these lazily; still need to dig into this. |
@jeremystretch This is ready for another review |
fe50aa1
to
7852522
Compare
Fixes: #11335
Introduce a custom default manager for ObjectChange, which automatically filters results to those referencing models belonging to currently installed apps.
All credit goes to @kkthxbye-code for coming up with this solution!