I noticed that when calling contrib.auth.forms.UserCreationForm.save(), self.save_m2m() is not called when commit=True.
This caused an issue in one of my projects which uses a custom User model with ManyToMany fields. Is this something that should be changed? I saw in the docs  that it is advised to extend UserCreationForm and UserChangeForm if using a custom User model.
A few reasons I see to add this step to the UserCreationForm.save() method:
- UserCreationForm is a subclass of ModelForm, which does call save_m2m() when commit=True.
- UserChangeForm does call save_m2m() as part of save(), because the save() method is not overloaded. This seems inconsistent!
The solution I'd propose is:
def save(self, commit=True):
user = super().save(commit=False)
if hasattr(self, "save_m2m"):
I'd be happy to raise a ticket and work on a patch if this change would be useful.