Skip to content

Commit

Permalink
changelist with complete name
Browse files Browse the repository at this point in the history
  • Loading branch information
benzkji committed May 25, 2018
1 parent 893294e commit acd04c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions separate_users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_urls(self):
class FrontendUserAdmin(SeparateUserAdminBase):
readonly_fields = ['date_joined', 'last_login', 'is_staff', 'is_superuser', 'groups', 'user_permissions', ]
list_filter = ['is_active', 'groups', ]
list_display = ['username', 'is_active', 'get_groups', ]
list_display = ['username', 'get_complete_name', 'is_active', 'get_groups', ]


admin.site.register(FrontendUser, FrontendUserAdmin)
Expand All @@ -37,7 +37,7 @@ class EditorAdmin(SeparateUserAdminBase):
exclude = []
readonly_fields = ['date_joined', 'last_login', 'is_staff', 'is_superuser', 'user_permissions', ]
list_filter = ['is_active', 'groups', ]
list_display = ['username', 'is_active', 'get_groups', ]
list_display = ['username', 'get_complete_name', 'is_active', 'get_groups', ]


admin.site.register(Editor, EditorAdmin)
5 changes: 5 additions & 0 deletions separate_users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def get_groups(self):

get_groups.short_description = ("Groups")

def get_complete_name(self):
return '{} {}'.format(self.first_name, self.last_name)

get_complete_name.short_description = ("Name")


class FrontendUser(SeparateUserBase, UserModel):

Expand Down

0 comments on commit acd04c9

Please sign in to comment.