FossilRepo

fossilrepo / accounts / admin.py
Source Blame History 20 lines
c588255… ragelink 1 from django.contrib import admin
c588255… ragelink 2
c588255… ragelink 3 from .models import PersonalAccessToken, UserProfile
c588255… ragelink 4
c588255… ragelink 5
c588255… ragelink 6 @admin.register(UserProfile)
c588255… ragelink 7 class UserProfileAdmin(admin.ModelAdmin):
c588255… ragelink 8 list_display = ("user", "handle", "location")
c588255… ragelink 9 search_fields = ("user__username", "handle", "location")
c588255… ragelink 10 raw_id_fields = ("user",)
c588255… ragelink 11 readonly_fields = ("user",)
c588255… ragelink 12
c588255… ragelink 13
c588255… ragelink 14 @admin.register(PersonalAccessToken)
c588255… ragelink 15 class PersonalAccessTokenAdmin(admin.ModelAdmin):
c588255… ragelink 16 list_display = ("name", "user", "token_prefix", "scopes", "created_at", "expires_at", "last_used_at", "revoked_at")
c588255… ragelink 17 list_filter = ("scopes",)
c588255… ragelink 18 search_fields = ("name", "user__username", "token_prefix")
c588255… ragelink 19 raw_id_fields = ("user",)
c588255… ragelink 20 readonly_fields = ("token_hash", "token_prefix", "created_at", "last_used_at")

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button