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

class CustomUserAdmin(UserAdmin):
    model = CustomUser
    # Definiramo koja polja se vide u admin listi i formama
    list_display = ['email', 'username', 'first_name', 'last_name', 'is_staff', 'is_serviser']
    fieldsets = UserAdmin.fieldsets + (
        ('Dodatni podaci', {'fields': ('telefon', 'oib', 'is_serviser')}),
    )

admin.site.register(CustomUser, CustomUserAdmin)