from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from .models import (
    Story,
    Mcq,
    Profile
)


class ProfileInline(admin.StackedInline):
    model = Profile
    can_delete = False
    verbose_name_plural = 'profile'


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


@admin.register(Profile)
class Profile(admin.ModelAdmin):
    list_display = ('user', 'first_name', 'last_name',
                    'assessed', 'total_points',)


@admin.register(Story)
class Story(admin.ModelAdmin):
    list_display = ('title', 'publish')


# Re-registeration of UserAdmin
admin.site.unregister(User)
admin.site.register(User, UserAdmin)

admin.site.register(Mcq)
