You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where Child is a many to many of Parent, and GrandChild is a many to many of Child,
that has min_num = 1 on GrandChildAdmin.
In this case, GrandChildAdmin.min_num = 1 was added after existing data was populated. Some of the existing data will have Child records that have no GrandChildren.
User tries to edit a Parent record that has Child records with no GrandChildren and delete a Child record with no GrandChildren. On save, the delete fails, with the error message This Field Is Required on GrandChildren.
If user adds a GrandChild just to be able to delete the Child, this also errors on save because the Child record is deleted first, then the insert into the Many To Many through table fails with a foreign key violation.
Can we ignore min_num validation on deletes?
The text was updated successfully, but these errors were encountered:
Hopefully I can explain this clearly:
On a nested admin page set up like this
ParentAdmin
-- inline ChildAdmin
---- inline GrandChildAdmin
where Child is a many to many of Parent, and GrandChild is a many to many of Child,
that has min_num = 1 on GrandChildAdmin.
In this case, GrandChildAdmin.min_num = 1 was added after existing data was populated. Some of the existing data will have Child records that have no GrandChildren.
User tries to edit a Parent record that has Child records with no GrandChildren and delete a Child record with no GrandChildren. On save, the delete fails, with the error message This Field Is Required on GrandChildren.
If user adds a GrandChild just to be able to delete the Child, this also errors on save because the Child record is deleted first, then the insert into the Many To Many through table fails with a foreign key violation.
Can we ignore min_num validation on deletes?
The text was updated successfully, but these errors were encountered: