Files
centurion_erp/app/access/admin.py
Jon 4b214d0b8c feat(admin): remove team management
not required as groups are teams and managed within the app interface.

also, the permissions within admin do not match what the intent of the app provides.

!1
2024-05-15 11:52:53 +09:30

31 lines
704 B
Python

from django.contrib import admin
from django.contrib.auth.models import Group
from .models import *
admin.site.unregister(Group)
class TeamInline(admin.TabularInline):
model = Team
extra = 0
readonly_fields = ['name', 'created', 'modified']
fields = ['team_name']
fk_name = 'organization'
class OrganizationAdmin(admin.ModelAdmin):
fieldsets = [
(None, {"fields": ["name", "slug"]}),
#("Date information", {"fields": ["slug"], "classes": ["collapse"]}),
]
inlines = [TeamInline]
list_display = ["name", "created", "modified"]
list_filter = ["created"]
search_fields = ["team_name"]
admin.site.register(Organization,OrganizationAdmin)