Opened 5 years ago

Last modified 5 years ago

#30951 closed Cleanup/optimization

Admin Documentation recommends an incorrect method to get selected objects. — at Version 1

Reported by: Daniel Owned by: nobody
Component: Documentation Version: 2.2
Severity: Normal 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 (last modified by Daniel)

PR to fix this: https://github.com/django/django/pull/12016

( https://docs.djangoproject.com/en/2.2/ref/contrib/admin/actions/#actions-that-provide-intermediate-pages )
/docs/ref/contrib/admin/actions.txt
in paragraph
Actions that provide intermediate pages

recommends directly accessing the form values:

selected = request.POST.getlist(admin.ACTION_CHECKBOX_NAME)

to get a list of selected ids. This fails to take into account if the select all box has been selected.

Change History (1)

Note: See TracTickets for help on using tickets.
Back to Top