Skip to content

Commit

Permalink
Merge pull request #647 from drnlm/feature/add_dates_to_user_list_admin
Browse files Browse the repository at this point in the history
Add fields to the user list to allow sorting by last login or date joined
  • Loading branch information
drnlm committed Sep 29, 2022
2 parents dc79856 + 46f889f commit 6d0ae5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wafer/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class UserProfileInline(admin.StackedInline):
class UserAdmin(UserAdmin):
inlines = (UserProfileInline,)

# We add date_joined and last login to the list view, as these can be
# useful for checking for spam accounts
list_display = ("username", "email", "first_name", "last_name",
"date_joined", "last_login", "is_staff")

def autocomplete_view(self, request):
"""Replace the autocomplete view for the users search widget"""
return AuthorAutocompleteView.as_view(model_admin=self)(request)
Expand Down

0 comments on commit 6d0ae5a

Please sign in to comment.