django-cruds-adminlte icon indicating copy to clipboard operation
django-cruds-adminlte copied to clipboard

Many-to-Many fields are not saved in inline forms

Open benmaier opened this issue 6 years ago • 0 comments

When editing a many-to-many-field in an inline form, the entries are not saved. The reason that this happens is that in inline_cruds.py, the form is called via

object = form.save(commit=False)

due to the commit=False, many-to-many fields will not be saved when object.save() is called.

To fix this, call form.save_m2m() after object.save() in inline_cruds.py

benmaier avatar Nov 12 '19 12:11 benmaier