20 lines
413 B
Python
20 lines
413 B
Python
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
from django.contrib.auth.models import User
|
|
|
|
from .models import Profile
|
|
|
|
|
|
class ProfileInline(admin.StackedInline):
|
|
model = Profile
|
|
inline_classes = ["collapse open"]
|
|
|
|
|
|
class UserProfileAdmin(UserAdmin):
|
|
inlines = [
|
|
ProfileInline,
|
|
]
|
|
|
|
|
|
admin.site.unregister(User)
|
|
admin.site.register(User, UserProfileAdmin)
|