Opened 2 hours ago
Last modified 2 hours ago
#37386 assigned Bug
Inconsistent treatment of 0 by ModelAdmin.delete_confirmation_max_display attribute — at Initial Version
| 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
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 overfetching under the hood. Then, for inlines, 0 now means the opposite ("show all").
Opening a PR with a unit test shortly.