-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Fixed #34816 -- Fixed GenericForeignKey crash when checking cached for primary keys with different types. #17234
Conversation
revert autoindent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, make sure change the MR description to point at 34816
and not 34813
.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Simon Charette <charette.s@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oguzhanakan0 Thanks 👍 I left comments.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oguzhanakan0 Thanks 👍 Welcome aboard ⛵
Following the suggestion in ticket/34816, changed the logic while accessing a GenericForeignKey to skip checking PK match if ContentType IDs do not match.
Test function is placed in
tests/generic_relations_regress.py
.Unit test output before the patch:
Everything seems to be working, thanks to rlaager for the suggestion and @felixxm for the test function.
P.S. This is my first contribution so please let me know if I missed anything. Thanks-