Opened 57 minutes ago
Last modified 35 minutes ago
#37386 assigned Bug
Inconsistent treatment of 0 by ModelAdmin.delete_confirmation_max_display attribute
| 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 )
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 , 40 minutes ago
| Has patch: | set |
|---|---|
| Needs tests: | unset |
comment:2 by , 35 minutes ago
| Description: | modified (diff) |
|---|
PR