|
@ -6,7 +6,7 @@ from django.template.loader import render_to_string |
|
|
from django.urls import reverse |
|
|
from django.urls import reverse |
|
|
from django.utils.html import escape |
|
|
from django.utils.html import escape |
|
|
from django.utils.safestring import mark_safe |
|
|
from django.utils.safestring import mark_safe |
|
|
from hc.accounts.models import Profile, Project |
|
|
|
|
|
|
|
|
from hc.accounts.models import Credential, Profile, Project |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@mark_safe |
|
|
@mark_safe |
|
@ -71,7 +71,7 @@ class TeamFieldset(Fieldset): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NumChecksFilter(admin.SimpleListFilter): |
|
|
class NumChecksFilter(admin.SimpleListFilter): |
|
|
title = "Checks" |
|
|
|
|
|
|
|
|
title = "check count" |
|
|
|
|
|
|
|
|
parameter_name = "num_checks" |
|
|
parameter_name = "num_checks" |
|
|
|
|
|
|
|
@ -116,9 +116,10 @@ class ProfileAdmin(admin.ModelAdmin): |
|
|
list_filter = ( |
|
|
list_filter = ( |
|
|
"user__date_joined", |
|
|
"user__date_joined", |
|
|
"last_active_date", |
|
|
"last_active_date", |
|
|
"reports_allowed", |
|
|
|
|
|
|
|
|
"reports", |
|
|
"check_limit", |
|
|
"check_limit", |
|
|
NumChecksFilter, |
|
|
NumChecksFilter, |
|
|
|
|
|
"theme", |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
fieldsets = (ProfileFieldset.tuple(), TeamFieldset.tuple()) |
|
|
fieldsets = (ProfileFieldset.tuple(), TeamFieldset.tuple()) |
|
@ -244,3 +245,13 @@ class HcUserAdmin(UserAdmin): |
|
|
|
|
|
|
|
|
admin.site.unregister(User) |
|
|
admin.site.unregister(User) |
|
|
admin.site.register(User, HcUserAdmin) |
|
|
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 |