Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#37270 closed Bug (fixed)

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: Ready for checkin
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.

Change History (5)

comment:1 by Jacob Walls, 3 weeks ago

Has patch: set

comment:2 by Sarah Boyce, 3 weeks ago

Triage Stage: UnreviewedAccepted

comment:3 by Sarah Boyce, 3 weeks ago

Triage Stage: AcceptedReady for checkin

comment:4 by Sarah Boyce <42296566+sarahboyce@…>, 3 weeks ago

Resolution: fixed
Status: assignedclosed

In 082b3df4:

Fixed #37270 -- Fixed incorrect values for second-degree relations in ModelAdmin.list_display.

comment:5 by Sarah Boyce <42296566+sarahboyce@…>, 3 weeks ago

In 969450e:

[6.1.x] Fixed #37270 -- Fixed incorrect values for second-degree relations in ModelAdmin.list_display.

Backport of 082b3df4067c3899dd4d57e8c2eca5baea9d07bb from main.

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