From 58a34ae061ff20e25794bb684bd64103d95b9163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 12 Dec 2018 18:12:04 +0200 Subject: [PATCH] Admin tweaks --- hc/api/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hc/api/admin.py b/hc/api/admin.py index 1e6069ca..7d299127 100644 --- a/hc/api/admin.py +++ b/hc/api/admin.py @@ -158,7 +158,7 @@ class ChannelsAdmin(admin.ModelAdmin): search_fields = ["value", "user__email"] list_select_related = ("user", ) - list_display = ("id", "code", "email", "formatted_kind", "value", + list_display = ("id", "name", "email", "formatted_kind", "value", "num_notifications") list_filter = ("kind", ) raw_id_fields = ("user", "checks", ) @@ -201,4 +201,7 @@ class NotificationsAdmin(admin.ModelAdmin): @admin.register(Flip) class FlipsAdmin(admin.ModelAdmin): - list_display = ("id", "created", "owner", "old_status", "new_status") + list_display = ("id", "created", "check_name", "old_status", "new_status") + + def check_name(self, obj): + return obj.owner.name if obj.owner.name else obj.owner.code