#15212 closed (fixed)
get_actions() always needs to return SortedDict, not list
| Reported by: | philomat | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
All docs state that get_actions() returns a dict. From documentation of ModelAdmin.get_actions():
"""
Return a __dictionary__ mapping the names of all actions...
"""
However:
if self.actions is None or IS_POPUP_VAR in request.GET:
return [] # list!
This can lead to problems when you extend that method and expect a dict, and treat its return value as such trying to modify its elements. My patch returns an empty SortedDict.
Attachments (1)
Change History (3)
by , 15 years ago
| Attachment: | fix_get_actions.diff added |
|---|
comment:1 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In [15393]: