Skip to content

Commit

Permalink
Add ordering field for sorting by date joined in CustomUserAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
FeloxleF committed Mar 18, 2024
1 parent 1bdc3a8 commit 4e4d79d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions activmindback/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CustomUserAdmin(UserAdmin):
# Définissez les champs que vous souhaitez afficher dans l'administration Django
list_display = ('email', 'user_type', 'is_active', 'is_staff', 'date_joined')
search_fields = ('email',) # Définissez les champs que vous souhaitez utiliser pour la recherche
ordering = ('date_joined',) # Définissez les champs que vous souhaitez utiliser pour le tri

# Enregistrez le modèle CustomUser avec CustomUserAdmin
admin.site.register(CustomUser, CustomUserAdmin)
Expand Down
1 change: 0 additions & 1 deletion activmindback/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@


# Register CustomUser and UserInfo models
admin.site.register(CustomUser)
admin.site.register(UserInfo)

0 comments on commit 4e4d79d

Please sign in to comment.