Skip to content

Commit

Permalink
Add last login date to the user list
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Nov 28, 2023
1 parent 43acfd4 commit ca0b33d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
v0.9.5
^^^^^^

* Added last login date to the user list
* Removed Reddit OAuth provider
* Reduced prefetched pages from 3 to 2

Expand Down
5 changes: 3 additions & 2 deletions users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class UserAdmin(admin.ModelAdmin):
form = UserForm
exclude = ('password', 'groups')
list_display = (
'username', '_email', 'full_name', 'date_joined', 'is_active'
'username', '_email', 'full_name',
'date_joined', 'last_login', 'is_active'
)
list_editable = ('is_active',)
search_fields = ('username', 'email', 'first_name', 'last_name')
Expand All @@ -146,7 +147,7 @@ class UserAdmin(admin.ModelAdmin):
UserTypeFilter,
)
ordering = ('username',)
sortable_by = ('username', 'full_name', 'date_joined')
sortable_by = ('username', 'full_name', 'date_joined', 'last_login')

@admin.display(description='e-mail address')
def _email(self, obj: User) -> str:
Expand Down

0 comments on commit ca0b33d

Please sign in to comment.