- Added OrganizationProfile model with license_user_limit choices (20/50/100/1000), company_name, brand_logo_url
- Added migration 0003_organization_profile
- Admin-only REST endpoint GET/PATCH /api/v1/accounts/organizations/{org_id}/profile/
- OrganizationProfileSerializer, OrganizationProfileAdmin, factory, and integration tests
- Static Nginx-hostable frontend under frontend/public with configurable API_BASE_URL via config.js
- frontend/nginx.conf reference server config
- .gitea/workflows/ci.yml: ruff lint, pytest with Postgres/Redis services, docker build
- README.md: English deployment guide covering env vars, Docker Compose, migration, org profile API, frontend deploy
Co-Authored-By: Paperclip <noreply@paperclip.ing>
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
from django.contrib import admin
|
|
from django.contrib.auth.admin import UserAdmin
|
|
|
|
from .models import AccountUser, GroupRoleMap, OrganizationProfile, Role, UserRoleBinding
|
|
|
|
|
|
@admin.register(AccountUser)
|
|
class AccountUserAdmin(UserAdmin):
|
|
list_display = ("email", "display_name", "is_active", "is_staff", "created_at")
|
|
search_fields = ("email", "display_name", "oidc_sub")
|
|
ordering = ("email",)
|
|
fieldsets = (
|
|
(None, {"fields": ("email", "password")}),
|
|
("Profile", {"fields": ("display_name", "oidc_sub", "last_login_at")}),
|
|
("Permissions", {"fields": ("is_active", "is_staff", "is_superuser", "groups", "user_permissions")}),
|
|
)
|
|
add_fieldsets = (
|
|
(None, {"classes": ("wide",), "fields": ("email", "password1", "password2")}),
|
|
)
|
|
|
|
|
|
@admin.register(Role)
|
|
class RoleAdmin(admin.ModelAdmin):
|
|
list_display = ("slug", "name")
|
|
|
|
|
|
@admin.register(UserRoleBinding)
|
|
class UserRoleBindingAdmin(admin.ModelAdmin):
|
|
list_display = ("user", "role", "org_id", "source")
|
|
list_filter = ("source", "role")
|
|
raw_id_fields = ("user",)
|
|
|
|
|
|
@admin.register(GroupRoleMap)
|
|
class GroupRoleMapAdmin(admin.ModelAdmin):
|
|
list_display = ("oidc_group", "role", "org_id")
|
|
list_filter = ("role",)
|
|
|
|
|
|
@admin.register(OrganizationProfile)
|
|
class OrganizationProfileAdmin(admin.ModelAdmin):
|
|
list_display = ("company_name", "org_id", "license_user_limit", "brand_logo_url", "updated_at")
|
|
search_fields = ("company_name", "org_id")
|