multi sector clustering erroro rasing, adn tasks page word coutn monthly limits removal

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-19 08:20:43 +00:00
parent e57c4bf1ac
commit 29ce8139d9
8 changed files with 155 additions and 86 deletions

View File

@@ -30,20 +30,12 @@ class ContentGenerationService:
Raises:
InsufficientCreditsError: If account doesn't have enough credits
"""
from igny8_core.business.billing.services.limit_service import LimitService, MonthlyLimitExceededError
# Get tasks
tasks = Tasks.objects.filter(id__in=task_ids, account=account)
# Calculate estimated credits needed based on word count
total_word_count = sum(task.word_count or 1000 for task in tasks)
# Check monthly word count limit
try:
LimitService.check_monthly_limit(account, 'content_words', amount=total_word_count)
except MonthlyLimitExceededError as e:
raise InsufficientCreditsError(str(e))
# Check credits
try:
self.credit_service.check_credits(account, 'content_generation', total_word_count)