Fixed #28384 -- Fixed ModelAdmin.lookup_allowed() for OneToOneField primary keys and nested relations.#16661
Merged
felixxm merged 1 commit intodjango:mainfrom Mar 28, 2023
Conversation
Member
|
I believe the case the comment refers to is when "restaurant__place__name" is disallowed (assuming place has a name field), "restaurant__place__id" should be allowed (even when other fields on place are disllowed) since "restaurant__place_id" is allowed. |
7bc55f6 to
460a690
Compare
Contributor
Author
|
Thank you Tim that helps! ⭐ What I have is breaking a couple of things because I am now too strict with which filters I allow
(this is why I have these very random additions to some Updating that this patch needs improvement, but if anyone has any clever ideas, that would be very helpful 👍 |
7ca0bcc to
874dcb6
Compare
Contributor
Author
|
Ok I have something that is good enough 👍 it's ready for a review |
felixxm
reviewed
Mar 21, 2023
84b2348 to
705438b
Compare
Member
|
@sarahboyce Thanks 👍 |
705438b to
93814d9
Compare
…rimary keys and nested relations.
93814d9 to
45ecd9a
Compare
Member
|
buildbot, test on selenium. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: https://code.djangoproject.com/ticket/28384
Notes:
I am not 100% sure whether there is something I am missing from this comment
I tried to include stuff around it in the test case but I don't really understand what it is getting at
The test itself is copied from the ticket, there is a test above
test_lookup_allowed_onetoonethat is very similar and can be tweaked to include this case but not sure if we want this to be in a separate test