From 0be3b6c8891208e5ec9448bab831f99a3b7a9199 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Thu, 25 Apr 2024 12:46:58 +0200 Subject: [PATCH] Link two first columns in Incident admin By default, the first displayed field is linked to the details page. The first field we show is `source_incident_id` which is optional. When it is not set there will be no link. Therefore, also link up the second field (`start_time`) so that we can always easily get to the details page. --- changelog.d/+fix-incident-admin-list-link.changed.md | 3 +++ src/argus/incident/admin.py | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelog.d/+fix-incident-admin-list-link.changed.md diff --git a/changelog.d/+fix-incident-admin-list-link.changed.md b/changelog.d/+fix-incident-admin-list-link.changed.md new file mode 100644 index 000000000..4cee23182 --- /dev/null +++ b/changelog.d/+fix-incident-admin-list-link.changed.md @@ -0,0 +1,3 @@ +Linked up the second column in the admin incident list to the details view in +addition to the default first column because the first column is currently an +optional field. If the field has no value there can also not be a link. diff --git a/src/argus/incident/admin.py b/src/argus/incident/admin.py index 40efa4fde..7378e0dcd 100644 --- a/src/argus/incident/admin.py +++ b/src/argus/incident/admin.py @@ -112,6 +112,10 @@ class IncidentTagRelationInline(admin.TabularInline): "get_open", "get_shown", ) + list_display_links = ( + "source_incident_id", + "start_time", + ) search_fields = ( "description", "source_incident_id",