Opened 7 years ago
Closed 7 years ago
#29465 closed Bug (invalid)
Admin._changeform_view incorrectly initializes ModelForm instance
Reported by: | Gert Steyn | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 2.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
In django.contrib.admin.options.ModelAdmin._changeform_view:
form = ModelForm(request.POST, request.FILES, instance=obj)
this line should be:
form = ModelForm(data=request.POST, files=request.FILES, instance=obj)
data and files are not positional arguments, this causes issues if a form with additional kwargs is used.
Change History (2)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Hello Gert,
From looking at the forms documentation both
data
andfiles
seem to be documented as positional so I'm going to close this ticket as invalid.