-
Notifications
You must be signed in to change notification settings - Fork 136
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
Error in nested inline not bubbling up #128
Comments
I am facing the same issue. |
The problem is that Since |
My fix occurs in some private code but I simply redefined def for form in formset:
if hasattr(form, 'nested_formsets'):
+ if not self.all_valid_with_nesting(form.nested_formsets):
+ # backstep error
+ form.errors[None] = [
+ f.errors + f.non_form_errors()
+ for f in form.nested_formsets
+ ]
return False |
I am using django-nested-inline with a model defined like this:
My Admin is defined in this way:
The form displays correctly, and works fine, until there is an error in the
RoomInlineStacked
. In which case, the error is only displayed within the inline formset, but not at the top level (where errors are normally shown)Errors within HouseInline are reported correctly at the top of the page. I'm expecting this to happen for the RoomInlineStacked as well. aka I'm expecting to see this (which doesn't happen at the moment):
I am trying to understand what's missing within
AdminErrorList
in https://github.com/s-block/django-nested-inline/blob/master/nested_inline/admin.py#L264 but I'm struggling to navigate the structure of formsets/forms/inlines and other attributes to find the error from the underlyingNestedStackedInline
and send it back up to theNestedModelAdmin
.Any pointers appreciated
The text was updated successfully, but these errors were encountered: