Skip to content

fix: #25882 persist required singleton inlines with default-only values on add#121

Merged
MartinCervenkaSB merged 3 commits intomainfrom
fix_add_singleton_inline
Mar 23, 2026
Merged

fix: #25882 persist required singleton inlines with default-only values on add#121
MartinCervenkaSB merged 3 commits intomainfrom
fix_add_singleton_inline

Conversation

@ViktorBojda
Copy link
Copy Markdown
Contributor

Django treats extra inline forms with only default values as unchanged, so they can be skipped during create. For parent add flow, we now force changed state for min=max=1 inlines so the inline form is validated and the related object is created.

Django treats extra inline forms with only default values as unchanged, so they can be skipped during create. For parent add flow, we now force changed state for min=max=1 inlines so the inline form is validated and the related object is created.
@ViktorBojda ViktorBojda marked this pull request as draft March 19, 2026 14:25
Viktor Bojda added 2 commits March 20, 2026 11:43
…clean

Move singleton add handling to formset validation flow and gate it by validate_min/validate_max on SBAdminInline. For required singletons (min=max=1), default-only inline forms are forced as changed during parent creation so min validation can pass and the related object can be created.
@ViktorBojda ViktorBojda marked this pull request as ready for review March 20, 2026 11:27
@ViktorBojda ViktorBojda changed the title fix: persist required singleton inlines with default-only values on add fix: ##25882 persist required singleton inlines with default-only values on add Mar 20, 2026
@ViktorBojda ViktorBojda changed the title fix: ##25882 persist required singleton inlines with default-only values on add fix: #25882 persist required singleton inlines with default-only values on add Mar 20, 2026
@MartinCervenkaSB MartinCervenkaSB merged commit 80b5cbb into main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants