mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-12 22:10:16 +02:00
Remove unpopulated first/last name fields from list display.
Include only useful information in list display.
This commit is contained in:
parent
54f91a5bfb
commit
539295c1b7
@ -108,12 +108,16 @@ class UserAdmin(BaseUserAdmin):
|
||||
return actions
|
||||
list_filter = BaseUserAdmin.list_filter + ('profile__state',)
|
||||
inlines = BaseUserAdmin.inlines + [UserProfileInline]
|
||||
list_display = BaseUserAdmin.list_display + ('get_main_character',)
|
||||
list_display = ('username', 'email', 'get_main_character', 'get_state', 'is_active')
|
||||
|
||||
def get_main_character(self, obj):
|
||||
return obj.profile.main_character
|
||||
get_main_character.short_description = "Main Character"
|
||||
|
||||
def get_state(self, obj):
|
||||
return obj.profile.state
|
||||
get_state.short_description = "State"
|
||||
|
||||
def has_change_permission(self, request, obj=None):
|
||||
return request.user.has_perm('auth.change_user')
|
||||
|
||||
@ -162,6 +166,9 @@ class CharacterOwnershipAdmin(admin.ModelAdmin):
|
||||
search_fields = ('user__username', 'character__character_name', 'character__corporation_name', 'character__alliance_name')
|
||||
readonly_fields = ('owner_hash', 'character')
|
||||
|
||||
def has_add_permission(self, request):
|
||||
return False
|
||||
|
||||
|
||||
class PermissionAdmin(admin.ModelAdmin):
|
||||
actions = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user