mirror of
https://github.com/thecyberlearn/quantum-ai-v3.git
synced 2026-08-18 14:32:57 +00:00
- Fix BaseAgent admin referencing non-existent fields (cost_per_request -> price, icon_name -> icon) - Add resend verification template and link to login page - Enhance email verification user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
957 B
Python
29 lines
957 B
Python
from django.contrib import admin
|
|
from .models import BaseAgent
|
|
|
|
|
|
@admin.register(BaseAgent)
|
|
class BaseAgentAdmin(admin.ModelAdmin):
|
|
list_display = ['name', 'slug', 'is_active', 'price', 'created_at']
|
|
list_filter = ['is_active', 'agent_type', 'created_at']
|
|
search_fields = ['name', 'slug', 'description']
|
|
readonly_fields = ['slug', 'created_at', 'updated_at']
|
|
ordering = ['name']
|
|
|
|
fieldsets = (
|
|
('Basic Information', {
|
|
'fields': ('name', 'slug', 'description', 'agent_type')
|
|
}),
|
|
('Configuration', {
|
|
'fields': ('is_active', 'price', 'icon')
|
|
}),
|
|
('Timestamps', {
|
|
'fields': ('created_at', 'updated_at'),
|
|
'classes': ('collapse',)
|
|
}),
|
|
)
|
|
|
|
def get_readonly_fields(self, request, obj=None):
|
|
if obj: # editing an existing object
|
|
return self.readonly_fields + ('agent_type',)
|
|
return self.readonly_fields |