I see you also posted this same question to Django-users. I'll copy the answer I've posted there:
Firstly, it is no use just giving the name of the error. Errors come with tracebacks, for good reason: they allow us to see exactly where the error is occurring, and the context.
Anyway, in your case, there doesn't seem to be any need to use
save_m2m
. The documentation states:
"Calling save_m2m() is only required if you use save(commit=False)"
In your case, you've already saved the form to get the new_restaurant
instance, and you're adding tags to that instance with no problem. The
last two calls, to new_restaurant.save()
and form.save_m2m()
, are unnecessary.