Opened 2 hours ago

Last modified 2 hours ago

#37386 assigned Bug

Inconsistent treatment of 0 by ModelAdmin.delete_confirmation_max_display attribute — at Version 2

Reported by: Jacob Walls Owned by: Jacob Walls
Component: contrib.admin Version: 6.1
Severity: Release blocker Keywords:
Cc: Karolis Ryselis Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Jacob Walls)

ModelAdmin.delete_confirmation_max_display was added first in #10919 (6.1), and it treated zero as "show no objects" about to be deleted.

It was then adapted for a very similar use for inlines in #36984 (6.1), but the treatment of 0 was flipped from "show none" to "show all".

We had an explicit test over the template response for the former case confirming "no objects shown", but the flipped logic still caused some over-processing under the hood. Then, for inlines, 0 now means the opposite ("show all").

Opening a PR with a unit test shortly.

Change History (2)

comment:1 by Jacob Walls, 2 hours ago

Has patch: set
Needs tests: unset

comment:2 by Jacob Walls, 2 hours ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top