diff -r 4c3ae065f22c -r 3b3999550508 src/notes/admin/auth.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/notes/admin/auth.py Thu Jun 08 17:57:57 2017 +0200 @@ -0,0 +1,25 @@ +from django.contrib import admin +from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin +from django.contrib.auth.admin import UserAdmin as BaseUserAdmin + +from notes.models import GroupProfile, UserProfile + + +# Define an inline admin descriptor for Employee model +# which acts a bit like a singleton +class UserProfileInline(admin.StackedInline): + model = UserProfile + can_delete = False + +# Define a new User admin +class UserAdmin(BaseUserAdmin): + inlines = (UserProfileInline, ) + + +class GroupProfileInline(admin.StackedInline): + model = GroupProfile + can_delete = False + + +class GroupAdmin(BaseGroupAdmin): + inlines = (GroupProfileInline, )