from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User

# Register your models here.
class CustomUserAdmin(UserAdmin):
    ordering = ('username', )
    list_display = ('username', 'first_name', 'last_name', 'is_staff')

    fieldsets = (
        (None, {'fields': ('username', 'first_name', 'last_name', 'email')}),
        ('Permissions', {'fields': ('groups', 'is_staff', 'is_active')}),        
    )

    add_fieldsets = (
        (None, {'fields': ('username', 'first_name', 'last_name', 'email', 'password1', 'password2', 'is_active', 'is_staff')}),
    )

admin.site.register(User, CustomUserAdmin)
