Skip to content

Commit

Permalink
Add CustomUserAdmin to core/admin.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FeloxleF committed Mar 18, 2024
1 parent 753bcd0 commit 1bdc3a8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions activmindback/core/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from django.contrib import admin
from rest_framework.authtoken.models import Token
from django.contrib.auth.admin import UserAdmin
from .models import CustomUser

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

# Enregistrez le modèle CustomUser avec CustomUserAdmin
admin.site.register(CustomUser, CustomUserAdmin)

class TokenAdmin(admin.ModelAdmin):
search_fields = ['token'] # Ajoutez les champs que vous souhaitez utiliser pour la recherche


0 comments on commit 1bdc3a8

Please sign in to comment.