Opened 5 years ago

Closed 5 years ago

#30951 closed Cleanup/optimization (duplicate)

Admin Documentation recommends an incorrect method to get selected objects.

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 (2)

comment:2 by Mariusz Felisiak, 5 years ago

Resolution: duplicate
Status: newclosed
Type: BugCleanup/optimization

Duplicate of #15742.

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