Opened 28 hours ago
Last modified 28 hours ago
#37270 assigned Bug
Second-degree relations in ModelAdmin.list_display look up values on wrong model
| Reported by: | Jacob Walls | Owned by: | Jacob Walls |
|---|---|---|---|
| Component: | contrib.admin | Version: | 6.1 |
| Severity: | Release blocker | Keywords: | |
| Cc: | RobKuipers | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
As pointed out in ticket:37230#comment:13, the attempt to fix #37230 just shuffled the failure around instead of fixing it.
Also, it's not just a crash in play -- the wrong value could have been looked up if the field name existed on both first & second degree models.
The comment repeats the suggestion to special-case boolean fields, but I continue to think that's the wrong approach, so I've added a test that fails if it's attempted by asserting over the correct behavior for password fields.
Thanks Rob Kuipers for the (re)report.
PR