Add speaker name to Submission's admin
@@ -19,6 +19,7 @@ class SubmissionCommentInline(admin.TabularInline):
class SubmissionAdmin(admin.ModelAdmin):
list_display = (
"title",
+ "speaker__name",
"type",
"conference",
"topic",
@@ -51,6 +52,9 @@ class SubmissionAdmin(admin.ModelAdmin):
filter_horizontal = ("tags",)
inlines = [SubmissionCommentInline]
+ def speaker__name(self, obj): # pragma: no cover
+ return obj.speaker.full_name or obj.speaker.name or obj.speaker.email
+
class Media:
js = ["admin/js/jquery.init.js"]
