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 #28357 -- Modified JavaScript for prepopulated fields #14967

Closed
wants to merge 2 commits into from
Closed

Fixed #28357 -- Modified JavaScript for prepopulated fields #14967

wants to merge 2 commits into from

Conversation

Zotyamester
Copy link

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.

@github-actions
Copy link

github-actions bot commented Oct 9, 2021

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 Zotyamester changed the title Fixed #28357 -- Modify JavaScript for prepopulated fields Fixed #28357 -- Modified JavaScript for prepopulated fields Oct 10, 2021
@felixxm
Copy link
Member

felixxm commented Oct 13, 2021

@Zotyamester Thanks for this patch 👍 A regression test is required.

@Zotyamester
Copy link
Author

Sorry for that. I was silly, and missed the semicolon at the end of the function expression. 😅

@Zotyamester
Copy link
Author

Zotyamester commented Oct 18, 2021

@felixxm Is it okay now? Or should I add more tests?

@felixxm
Copy link
Member

felixxm commented Oct 18, 2021

@felixxm Is it okay now? Or should I add more tests?

I don't see any new tests in this patch 🤔

@Zotyamester
Copy link
Author

Forgot to commit those. 😅
But here they are now.

@felixxm
Copy link
Member

felixxm commented Oct 19, 2021

Forgot to commit those. sweat_smile But here they are now.

This test works without a patch, so it's not a proper regression test.

@Zotyamester
Copy link
Author

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.

@felixxm
Copy link
Member

felixxm commented Oct 19, 2021

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.

@felixxm
Copy link
Member

felixxm commented Nov 15, 2021

Updated in #15091.

@felixxm felixxm closed this Nov 15, 2021
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