Skip to content
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 #35393 -- Added excluded primary keys as hidden fields for the inline admin. #18094

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

KommuSoft
Copy link
Contributor

@KommuSoft KommuSoft commented Apr 21, 2024

Trac ticket number

ticket-35393

Branch description

Provide a concise overview of the issue or rationale behind the proposed changes.

The original main branch had an AdminInline where one can exclude an (editable) primary key, as a result the Django admin could no longer back-reference the forms to the original item.

The fix includes a hidden primary key HTML element to back reference correctly, and update the elements accordingly. See also https://stackoverflow.com/q/78353321/67579 and https://code.djangoproject.com/ticket/35393 .

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • [-] I have added or updated relevant docs, including release notes if applicable.
  • [-] For UI changes, I have attached screenshots in both light and dark modes.

…fields for the inline admin, and thus ensure that this matches with the original element, fixing #35393.
@timgraham
Copy link
Member

Can you add a test?

@sarahboyce sarahboyce changed the title also look for an excluded primary key, to include this in the hidden fields for the inline admin, and thus ensure that this matches with the original element, fixing #35393. Fixed #35393 -- Added excluded primary keys as hidden fields for the inline admin. Apr 23, 2024
@KommuSoft
Copy link
Contributor Author

@timgraham : added a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants