30👍
✅
Since you use commit=false
for the super(RegistrationForm, self).save
call, it doesn’t save the many-to-many field. You therefore need to add self.save_m2m()
after user.save()
in your save()
method of RegistrationForm
.
See https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method
EDIT: save_m2m()
is on the Form, not the Model
Source:stackexchange.com