Opened 6 years ago
Last modified 6 years ago
#29465 closed Bug
Admin._changeform_view incorrectly initializes ModelForm instance — at Version 1
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.
Note:
See TracTickets
for help on using tickets.