Skip to content

Commit f56bfcb

Browse files
feat: more clickable message admin (#10307)
1 parent 5d2790b commit f56bfcb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ietf/message/admin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def queryset(self, request, queryset):
2727

2828

2929
class MessageAdmin(admin.ModelAdmin):
30-
list_display = ["sent_status", "subject", "by", "time", "groups"]
30+
list_display = ["sent_status", "display_subject", "by", "time", "groups"]
31+
list_display_links = ["display_subject"]
3132
search_fields = ["subject", "body"]
3233
raw_id_fields = ["by", "related_groups", "related_docs"]
3334
list_filter = [
@@ -37,6 +38,10 @@ class MessageAdmin(admin.ModelAdmin):
3738
ordering = ["-time"]
3839
actions = ["retry_send"]
3940

41+
@admin.display(description="Subject", empty_value="(no subject)")
42+
def display_subject(self, instance):
43+
return instance.subject or None # None triggers the empty_value
44+
4045
def groups(self, instance):
4146
return ", ".join(g.acronym for g in instance.related_groups.all())
4247

0 commit comments

Comments
 (0)