#8999: ModelAdmin.get_form and get_formset will overwrite self.exclude with a
kwargs exclude
-------------------------------------+-------------------------------------
Reporter: seanl | Owner: jkocherhans
Type: | Status: assigned
Cleanup/optimization | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.0 | Keywords:
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Changes (by julien):
* needs_better_patch: 1 => 0
* type: Bug => Cleanup/optimization
Comment:
I agree with jkocherhans that the `exclude` kwarg should completely
override any other declarations rather than being combined to them. So,
the current behaviour is actually correct.
The line "`exclude.extend(kwargs.get("exclude", []))`", which seems to
suggest that the kwarg should be combined, is actually useless and it can
be safely removed. The attached patch removes that line and verifies the
current behaviour both for `ModelAdmin.get_form()` and
`InlineAdmin.get_formset()`.
--
Ticket URL: <http://code.djangoproject.com/ticket/8999#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.