Skip to content

Commit

Permalink
feat: DEV-1533: add activate user to django admin (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
makseq authored Jan 21, 2022
1 parent 074af78 commit 3e54faf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions label_studio/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class UserAdminShort(UserAdmin):
def __init__(self, *args, **kwargs):
super(UserAdminShort, self).__init__(*args, **kwargs)

# we have empty username - remove it to escape confuse about empty fields in admin web
self.list_display = [l for l in self.list_display if l != 'username']
self.list_display = ('email', 'username', 'active_organization', 'organization', 'is_staff', 'is_superuser')
self.list_filter = ('is_staff', 'is_superuser', 'is_active')
self.search_fields = ('username', 'first_name', 'last_name', 'email',
'organization__title', 'active_organization__title')
self.ordering = ('email',)

self.fieldsets = ((None, {'fields': ('password', )}),
('Personal info', {'fields': ('first_name', 'last_name', 'email')}),
Expand Down

0 comments on commit 3e54faf

Please sign in to comment.