1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #34187 -- Made UserCreationForm save many-to-many fields.

This commit is contained in:
sdolemelipone
2022-11-27 19:49:02 +00:00
committed by Mariusz Felisiak
parent 60a7bd8986
commit 9d726c7902
5 changed files with 35 additions and 0 deletions

View File

@@ -141,6 +141,8 @@ class UserCreationForm(forms.ModelForm):
user.set_password(self.cleaned_data["password1"])
if commit:
user.save()
if hasattr(self, "save_m2m"):
self.save_m2m()
return user