Opened 2 years ago
Closed 2 years ago
#34187 closed New feature (fixed)
UserCreationForm should save data from ManyToMany form fields
Reported by: | Mark Gensler | Owned by: | Mark Gensler |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Normal | Keywords: | UserCreationForm save_m2m |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When using contrib.auth.forms.UserCreationForm
with a custom User model which has ManyToManyField
fields, the data in all related form fields (e.g. a ModelMultipleChoiceField
) is not saved.
This is because unlike its parent class django.forms.ModelForm
, UserCreationForm.save(commit=True)
omits to call self.save_m2m()
.
This has been discussed on the #django-developers mailing list https://groups.google.com/u/1/g/django-developers/c/2jj-ecoBwE4 and I'm ready to work on a PR.
Change History (8)
comment:1 by , 2 years ago
Needs tests: | set |
---|
comment:2 by , 2 years ago
Component: | contrib.admin → contrib.auth |
---|
comment:3 by , 2 years ago
Needs tests: | unset |
---|
comment:4 by , 2 years ago
Has patch: | set |
---|
comment:5 by , 2 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 4.1 → dev |
Version 0, edited 2 years ago by (next)
comment:6 by , 2 years ago
Needs documentation: | set |
---|
comment:7 by , 2 years ago
Needs documentation: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
Sounds reasonable.
PR