From d63f8f2e33174ee308d43f821fcded294ef644b4 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 10 Jan 2019 11:08:05 +0100 Subject: [PATCH] Added django admin module to manage instance policies --- api/funkwhale_api/moderation/admin.py | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 api/funkwhale_api/moderation/admin.py diff --git a/api/funkwhale_api/moderation/admin.py b/api/funkwhale_api/moderation/admin.py new file mode 100644 index 000000000..5e421255e --- /dev/null +++ b/api/funkwhale_api/moderation/admin.py @@ -0,0 +1,30 @@ +from funkwhale_api.common import admin + +from . import models + + +@admin.register(models.InstancePolicy) +class InstancePolicyAdmin(admin.ModelAdmin): + list_display = [ + "actor", + "target_domain", + "target_actor", + "creation_date", + "block_all", + "reject_media", + "silence_activity", + "silence_notifications", + ] + list_filter = [ + "block_all", + "reject_media", + "silence_activity", + "silence_notifications", + ] + search_fields = [ + "actor__fid", + "target_domain__name", + "target_domain__actor__fid", + "summary", + ] + list_select_related = True