Refactor error_response function for improved argument handling

- Enhanced the `error_response` function to support backward compatibility by normalizing arguments when positional arguments are misused.
- Updated various views to pass `None` for the `errors` parameter in `error_response` calls, ensuring consistent response formatting.
- Adjusted logging in `ContentSyncService` and `WordPressClient` to use debug level for expected 401 errors, improving log clarity.
- Removed deprecated fields from serializers and views, streamlining content management processes.
This commit is contained in:
IGNY8 VPS (Salman)
2025-11-22 03:04:35 +00:00
parent c84bb9bc14
commit 84c18848b0
10 changed files with 424 additions and 51 deletions

View File

@@ -1018,16 +1018,14 @@ class ContentIdeasViewSet(SiteSectorModelViewSet):
keywords=idea.target_keywords or '',
cluster=idea.keyword_cluster,
idea=idea,
content_structure=idea.content_structure,
content_type=idea.content_type,
status='queued',
account=idea.account,
site=idea.site,
sector=idea.sector,
# Stage 3: Inherit entity metadata
entity_type=idea.site_entity_type or 'blog_post',
# Stage 3: Inherit entity metadata (use standardized fields)
entity_type=(idea.site_entity_type or 'post'),
taxonomy=idea.taxonomy,
cluster_role=idea.cluster_role or 'hub',
cluster_role=(idea.cluster_role or 'hub'),
)
created_tasks.append(task.id)
# Update idea status