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

from apps.users.models import UserDetails


class UserDetailsInline(admin.StackedInline):
    model = UserDetails
    can_delete = False
    verbose_name_plural = 'Users Details'


class UserAdmin(BaseUserAdmin):
    inlines = (UserDetailsInline,)


admin.site.unregister(User)
admin.site.register(User, UserAdmin)
