gva/gnuviechadmin/osusers/admin.py
Jan Dittberner 9d447cac0b improve osusers admin interface
- set user uid to readonly
- set shadow password readonly
- set can_delete on shadow to False
2014-05-24 23:15:14 +02:00

27 lines
495 B
Python

from django.contrib import admin
from .models import (
AdditionalGroup,
Group,
Shadow,
User,
)
class AdditionalGroupInline(admin.TabularInline):
model = AdditionalGroup
class ShadowInline(admin.TabularInline):
model = Shadow
readonly_fields = ['passwd']
can_delete = False
class UserAdmin(admin.ModelAdmin):
inlines = [AdditionalGroupInline, ShadowInline]
readonly_fields = ['uid']
admin.site.register(Group)
admin.site.register(User, UserAdmin)