Deleting inline model in Django admin
- by Overclocked
I am trying to use Django admin to remove an inline model. I get an error saying
[u'Select a valid choice. That choice is not one of the available choices.']
I check the location where the exception is raised. It seems like the inline model was removed, then a form validation happened on the parent model with the deleted inline model still as value of the form. That caused the failure.
In my admin model, I had a save_formset method defined, that called formset.save(commit=False). Is the commit=False not telling Django to not delete the related models?
Thanks.