diff --git a/hc/accounts/admin.py b/hc/accounts/admin.py index 40e1444b..5487dabf 100644 --- a/hc/accounts/admin.py +++ b/hc/accounts/admin.py @@ -6,7 +6,7 @@ from django.template.loader import render_to_string from django.urls import reverse from django.utils.html import escape from django.utils.safestring import mark_safe -from hc.accounts.models import Profile, Project +from hc.accounts.models import Credential, Profile, Project @mark_safe @@ -71,7 +71,7 @@ class TeamFieldset(Fieldset): class NumChecksFilter(admin.SimpleListFilter): - title = "Checks" + title = "check count" parameter_name = "num_checks" @@ -116,9 +116,10 @@ class ProfileAdmin(admin.ModelAdmin): list_filter = ( "user__date_joined", "last_active_date", - "reports_allowed", + "reports", "check_limit", NumChecksFilter, + "theme", ) fieldsets = (ProfileFieldset.tuple(), TeamFieldset.tuple()) @@ -244,3 +245,13 @@ class HcUserAdmin(UserAdmin): admin.site.unregister(User) admin.site.register(User, HcUserAdmin) + + +@admin.register(Credential) +class CredentialAdmin(admin.ModelAdmin): + list_display = ("id", "created", "email", "name") + search_fields = ["id", "code", "name", "user__email"] + list_filter = ["created"] + + def email(self, obj): + return obj.user.email