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:
@@ -185,8 +185,8 @@ class ContentIdeasSerializer(serializers.ModelSerializer):
|
||||
'id',
|
||||
'idea_title',
|
||||
'description',
|
||||
'content_structure',
|
||||
'content_type',
|
||||
'site_entity_type',
|
||||
'cluster_role',
|
||||
'target_keywords',
|
||||
'keyword_cluster_id',
|
||||
'keyword_cluster_name',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user