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

Allow formsets to be omitted when ClusterForm.formsets not explicitly passed #119

Closed
wants to merge 1 commit into from

Conversation

gasman
Copy link
Contributor

@gasman gasman commented Dec 19, 2019

As per wagtail/wagtail#5414 (comment) - #106 changed the base form class of child forms to ClusterForm, which means that (in the absence of an explicit 'formsets' parameter) they now expect form submissions to contain formsets for every child relation on that model. This breaks some Wagtail setups where child relations exist but are not handled through InlinePanel - e.g tag fields.

Here we modify that behaviour so that, if 'formsets' is not explicitly set on the ClusterForm, it silently skips over any formsets missing from the submission, restoring the previous behaviour.

… passed

As per wagtail/wagtail#5414 (comment) - wagtail#106 changed the base form class of child forms to ClusterForm, which means that (in the absence of an explicit 'formsets' parameter) they now expect form submissions to contain formsets for every child relation on that model. This breaks some Wagtail setups where child relations exist but are not handled through InlinePanel - e.g tag fields.

Here we modify that behaviour so that, if 'formsets' is not explicitly set on the ClusterForm, it silently skips over any formsets missing from the submission, restoring the previous behaviour.
@gasman
Copy link
Contributor Author

gasman commented Jan 6, 2020

Merged in 74584c4 (4.x) and ef6f0a0 (5.x).

@gasman gasman closed this Jan 6, 2020
@gasman gasman deleted the fix/omitted-forms branch January 6, 2020 17:55
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.

None yet

1 participant