#36063 closed Bug (fixed)

Fields in list_display_links should always navigate to the object "change" page

Reported by: Antoliny Owned by: Antoliny
Component: contrib.admin Version: 5.1
Severity: Normal Keywords: items_for_result, ImageField, FileField
Cc: 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

When fields with links, such as FileField and ImageField, are set in the list_display_links in Django's admin app list page, they do not navigate to the detail page of the corresponding object.

class StockAdmin(ModelAdmin):
    list_display_links = ("file_field",)
    list_display = (
        "email_field",
        "file_field",
        "image_field",
    )


Attachments (2)

file_field_display_err.png​ (158.8 KB ) - added by Antoliny 22 months ago.
file_field_display_err(2).png​ (158.8 KB ) - added by Antoliny 22 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Antoliny, 22 months ago

Owner: set to Antoliny
Status: new → assigned

by Antoliny, 22 months ago

Attachment: file_field_display_err.png​ added

by Antoliny, 22 months ago

comment:2 by Antoliny, 22 months ago

Has patch: set

comment:4 by Sarah Boyce, 22 months ago

Summary: When a field with a link is set in list_display_links(FileField, ImageField), it does not navigate to the detail page. → Fields in list_display_links should always navigate to the object "change" page
Triage Stage: Unreviewed → Accepted

Thank you!

comment:5 by Sarah Boyce, 22 months ago

Patch needs improvement: set

comment:6 by Antoliny, 22 months ago

Patch needs improvement: unset

comment:7 by Sarah Boyce, 22 months ago

Triage Stage: Accepted → Ready for checkin

comment:8 by Sarah Boyce <42296566+sarahboyce@…>, 22 months ago

Resolution: → fixed
Status: assigned → closed

In a9c79b4:

Fixed #36063 -- Made a FileField navigate to the object admin change page when in list_display_links.

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