imp part 5

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-30 14:37:28 +00:00
parent 1632ee62b6
commit 6953343026
14 changed files with 155 additions and 463 deletions

View File

@@ -1,5 +1,4 @@
from rest_framework import serializers
from django.conf import settings
from .models import Keywords, Clusters, ContentIdeas
from igny8_core.auth.models import SeedKeyword
@@ -69,12 +68,6 @@ class KeywordSerializer(serializers.ModelSerializer):
]
read_only_fields = ['id', 'created_at', 'updated_at', 'account_id', 'keyword', 'volume', 'difficulty', 'country']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Only include Stage 1 fields when feature flag is enabled
if getattr(settings, 'USE_SITE_BUILDER_REFACTOR', False):
self.fields['attribute_values'] = serializers.JSONField(read_only=True)
def validate(self, attrs):
"""Validate that either seed_keyword_id OR custom keyword fields are provided"""
# For create operations, need either seed_keyword_id OR custom keyword