BillingConfiguration model doesn't exist in the codebase, causing ImportError
and preventing backend from starting. Removed the import and admin class.
This was causing the backend to be stuck in restarting state.
The AdminSystemDashboard file doesn't exist in the codebase and was causing
a 500 error. Removed the lazy import and route that referenced it.
This aligns with the recent removal of the aws-admin pattern from the backend.
Added comprehensive documentation of all UX text improvements:
- 23 files modified across 7 commits
- Complete before/after comparison for all changes
- Implementation details by module
- Testing recommendations and next steps
- No breaking changes - display text only
This document serves as the complete reference for the UX text improvement initiative.
- Updated page title: 'Help & Documentation' → 'How Can We Help You?'
- Updated page description to be more conversational:
'Complete guides and documentation to help you get the most out of IGNY8'
→ 'Everything you need to know to create amazing content with IGNY8'
Part of comprehensive UX text improvement initiative.
- Updated page titles to be more user-friendly:
* Account Settings: 'Account Settings' → 'Your Account Settings'
* AI Settings: 'AI Settings' → 'Your AI Settings'
* General Settings description updated to be more conversational
- Updated descriptions to be more conversational:
* Account: 'Account-level configuration' → 'Manage your account preferences'
* AI: 'AI-specific configuration' → 'Configure how AI works for you'
* General: 'Configure plugin settings...' → 'Choose your preferences...'
Part of comprehensive UX text improvement initiative.
- Updated page title: 'Add Keywords' → 'Find & Add Keywords to Your Site'
- Updated sector selection banner:
* Header: 'Select a Sector to Add Keywords' → 'Choose a Topic Area First'
* Description simplified and made more conversational
- Updated import modal:
* Title: 'Import Seed Keywords' → 'Import Your Keywords'
* CSV label: 'Upload CSV File' → 'Upload Your CSV File'
* Column descriptions made more user-friendly
Part of comprehensive UX text improvement initiative.
ARCHITECTURE FIX:
- aws-admin IntegrationSettings will NEVER exist (it's a legacy pattern)
- Only user's own account IntegrationSettings can exist (if they override defaults)
- Otherwise GlobalIntegrationSettings is used directly
- API keys are ALWAYS from GlobalIntegrationSettings (accounts cannot override API keys)
REMOVED:
- All aws-admin Account lookups
- All aws-admin IntegrationSettings fallback attempts
- Confusing nested try/except chains
CORRECT FLOW NOW:
1. Try account's IntegrationSettings for config overrides
2. Use GlobalIntegrationSettings for missing values and ALL API keys
3. No intermediate aws-admin lookups
ROOT CAUSES IDENTIFIED:
1. GlobalAIPrompt template had unescaped JSON braces that broke Python's .format()
- Python treats {...} as placeholders, causing KeyError when rendering
- Escaped JSON braces to {{...}} while preserving {title}, {content}, {max_images}
2. Image functions hardcoded aws-admin IntegrationSettings which didn't exist
- Functions failed when aws-admin account had no IntegrationSettings
- Added GlobalIntegrationSettings fallback for all missing values
CHANGES:
- Fixed GlobalAIPrompt.image_prompt_extraction template in database (escaped JSON)
- Updated generate_image_prompts._get_max_in_article_images() with fallback
- Updated generate_images.prepare_data() with fallback for all image settings
- Updated tasks.process_image_generation_queue() with fallback for config + API keys
TESTED: Template rendering now works, GlobalIntegrationSettings.max_in_article_images=4
- Added AIModelConfig model to manage AI model configurations in the database.
- Created serializers and views for AI model configurations, enabling read-only access via REST API.
- Implemented filtering capabilities for model type, provider, and default status in the API.
- Seeded initial data for text and image models, including pricing and capabilities.
- Updated Django Admin interface for managing AI models with enhanced features and bulk actions.
- Added validation methods for model and image size checks.
- Comprehensive migration created to establish the AIModelConfig model and seed initial data.
- Documented implementation and validation results in summary and report files.
- Backfills model_config FK from model_name in CreditUsageLog
- Calculates cost_usd_input/output/total from tokens and model pricing
- Processes in configurable batches (default 500)
- Includes dry-run mode for safety
- Successfully backfilled 250 historical logs
- Enables full token analytics on historical data
- Reverted to commit #10 (98e68f6) for stable AI function base
- Fixed database migrations: removed 0018-0019 that broke schema
- Fixed CreditCostConfig schema: restored credits_cost, unit fields
- Fixed historical table schema for django-simple-history
- Added debug system (staged for future use)
Changes:
- CreditCostConfig: Updated OPERATION_TYPE_CHOICES (10 ops, no duplicates)
- CreditUsageLog: Updated choices with legacy aliases marked
- Migration 0018_update_operation_choices: Applied successfully
- All AI operations working (clustering, ideas, content, optimization, etc.)
Test Results:
✓ CreditCostConfig save/load working
✓ Credit check passing for all operations
✓ AICore initialization successful
✓ AIEngine operation mapping functional
✓ Admin panel accessible without 500 errors
Future: AI-MODEL-COST-REFACTOR-PLAN.md created for token-based system
- Introduced GlobalModuleSettings model for platform-wide module enable/disable settings.
- Added 'caption' field to Images model to store image captions.
- Updated GenerateImagePromptsFunction to handle new caption structure in prompts.
- Enhanced AIPromptViewSet to return global prompt types and validate active prompts.
- Modified serializers and views to accommodate new caption field and global settings.
- Updated frontend components to display captions and filter prompts based on active types.
- Created migrations for GlobalModuleSettings and added caption field to Images.
feat(admin): Add API monitoring, debug console, and system health templates for enhanced admin interface
docs: Add AI system cleanup summary and audit report detailing architecture, token management, and recommendations
docs: Introduce credits and tokens system guide outlining configuration, data flow, and monitoring strategies