This commit is contained in:
alorig
2025-11-29 15:35:41 +05:00
parent 0549dea124
commit 9e6868fe69
5 changed files with 99 additions and 8 deletions

View File

@@ -89,10 +89,15 @@ class PublisherViewSet(viewsets.ViewSet):
"destinations": ["wordpress", "sites"] # Required: list of destinations
}
"""
import logging
logger = logging.getLogger(__name__)
content_id = request.data.get('content_id')
site_blueprint_id = request.data.get('site_blueprint_id')
destinations = request.data.get('destinations', [])
logger.info(f"[PublisherViewSet.publish] 🚀 Publish request received: content_id={content_id}, destinations={destinations}")
if not destinations:
return error_response(
'destinations is required',
@@ -125,11 +130,13 @@ class PublisherViewSet(viewsets.ViewSet):
elif content_id:
# Publish content
logger.info(f"[PublisherViewSet.publish] 📝 Publishing content {content_id} to {destinations}")
result = self.publisher_service.publish_content(
content_id,
destinations,
account
)
logger.info(f"[PublisherViewSet.publish] {'' if result.get('success') else ''} Publish result: {result}")
return success_response(result, request=request)
else: