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 #28357 -- Modified JavaScript for prepopulated fields #14967
Conversation
Hello @Zotyamester! Thank you for your contribution 💪 As it's your first contribution be sure to check out the patch review checklist. If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket! If you have any design or process questions then you can ask in the Django forum. Welcome aboard ⛵️! |
@Zotyamester Thanks for this patch 👍 A regression test is required. |
Sorry for that. I was silly, and missed the semicolon at the end of the function expression. 😅 |
@felixxm Is it okay now? Or should I add more tests? |
I don't see any new tests in this patch 🤔 |
Forgot to commit those. 😅 |
This test works without a patch, so it's not a proper regression test. |
And then how exactly should I write it? I'm asking it, because I haven't seen one test case that relied on Django models with prepopulated fields. |
Have you seen the previous PR for this ticket? It contains a selenium test can be an inspiration for you. |
Updated in #15091. |
Fixes #28357: The
prepopulated_fields
will work for the extra forms specified, in the admin.StackedInline, but in case of any additional forms that are added via "Add another " will not run the JS that pre populates the field. admin.TabularInline seems to work fine and is unaffected by this.