Skip to content

Commit 27abaae

Browse files
committed
Tweaked and enhanced doc.admin.DocEventAdmin.
- Legacy-Id: 12276
1 parent 7f1c1e4 commit 27abaae

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

ietf/doc/admin.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,14 @@ class BallotTypeAdmin(admin.ModelAdmin):
137137

138138
class DocEventAdmin(admin.ModelAdmin):
139139
def rev(self, obj):
140-
return obj.get_dochistory().rev
140+
h = obj.get_dochistory()
141+
return h.rev if h else ""
141142
def doc_time(self, obj):
142-
return obj.get_dochistory().time
143-
list_display = ["id", "doc", "type", "rev", "by", "time", "doc_time" ]
143+
h = obj.get_dochistory()
144+
return h.time if h else ""
145+
def short_desc(self, obj):
146+
return obj.desc[:32]
147+
list_display = ["id", "doc", "type", "rev", "by", "time", "doc_time", "short_desc" ]
144148
search_fields = ["doc__name", "by__name"]
145149
raw_id_fields = ["doc", "by"]
146150
admin.site.register(DocEvent, DocEventAdmin)

0 commit comments

Comments
 (0)