From da5de371d4c0893e593930a8687993fc1342033d Mon Sep 17 00:00:00 2001 From: Geoff Von Allmen Date: Thu, 8 Aug 2024 13:20:06 -0700 Subject: [PATCH] refactor: Add LtiToolOrgAdmin to admin --- src/lti_1p3_provider/admin.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lti_1p3_provider/admin.py b/src/lti_1p3_provider/admin.py index b5b581e..6bcbadf 100644 --- a/src/lti_1p3_provider/admin.py +++ b/src/lti_1p3_provider/admin.py @@ -30,3 +30,14 @@ class LtiProfileAdmin(admin.ModelAdmin): @admin.register(models.LtiGradedResource) class LtiGradedResourceAdmin(admin.ModelAdmin): pass + + +@admin.register(models.LtiToolOrg) +class LtiTooLOrgAdmin(admin.ModelAdmin): + list_display = ("tool_name", "org_name") + + def tool_name(self, obj) -> str: + return f"{obj.tool.title} ({obj.tool.client_id})" + + def org_name(self, obj) -> str: + return obj.org.short_name