feat(apps): add role‑based CustomUser admin and ticketing system
- New Features * Introduce CustomUser with role field and admin integration * Add ProjectMembership model linking users to projects * Add Ticket model with status, type, creator, and project relationships * Register CustomUser and ProjectMembership in Django admin with list views * Add URLs and views for account management and ticket CRUD operations - Enhancements * Provide pagination and filtering for ticket listings * Improve admin UI with role‑specific fieldsets - Bug Fixes * Remove obsolete serializers and placeholder files
This commit is contained in:
37 files changed
+954
-126
No files matched your search
+20
-3
@@ -1,5 +1,22 @@
|
||||
"""generated with djinit"""
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin
|
||||
|
||||
# Register your models here.
|
||||
from apps.accounts.models import CustomUser, ProjectMembership
|
||||
|
||||
|
||||
@admin.register(CustomUser)
|
||||
class CustomUserAdmin(UserAdmin):
|
||||
list_display = ["username", "email", "role", "is_active"]
|
||||
list_filter = ["role", "is_active"]
|
||||
fieldsets = UserAdmin.fieldsets + (
|
||||
("Role Info", {"fields": ("role",)}),
|
||||
)
|
||||
add_fieldsets = UserAdmin.add_fieldsets + (
|
||||
("Role Info", {"fields": ("role",)}),
|
||||
)
|
||||
|
||||
|
||||
@admin.register(ProjectMembership)
|
||||
class ProjectMembershipAdmin(admin.ModelAdmin):
|
||||
list_display = ["user", "project", "joined_at"]
|
||||
list_filter = ["project"]
|
||||
Reference in new issue
Block a user