From a304078a110d572195db6d579b251bc48df552c9 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Thu, 19 Mar 2026 12:23:47 +0000 Subject: [PATCH] Fix CSV export: use correct agent_review JSON keys for RAG columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit legalAgentReview, brandAgentReview, channelBestPracticesAgentReview, channelTechSpecsAgentReview, and leadAgentSummary are the actual keys stored in the JSONB column — not legalAgent, brandAgent, channelAgent.*, and leadAgent.summary which were causing empty CSV values. --- backend/app/repositories/campaign_repository.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/repositories/campaign_repository.py b/backend/app/repositories/campaign_repository.py index bdf310c..c7fdcd3 100755 --- a/backend/app/repositories/campaign_repository.py +++ b/backend/app/repositories/campaign_repository.py @@ -229,11 +229,11 @@ class CampaignRepository: "Overall Status": row.overall_status or "", "Version Workfront ID": row.version_workfront_id or "", "Version Created": row.version_created_at.strftime("%Y-%m-%d %H:%M:%S") if row.version_created_at else "", - "Legal RAG": (agent_review.get("legalAgent") or {}).get("ragStatus") or "", - "Brand RAG": (agent_review.get("brandAgent") or {}).get("ragStatus") or "", - "Channel Best Practices RAG": (agent_review.get("channelAgent") or {}).get("bestPractices", {}).get("ragStatus") if agent_review.get("channelAgent") else "", - "Channel Tech Specs RAG": (agent_review.get("channelAgent") or {}).get("techSpecs", {}).get("ragStatus") if agent_review.get("channelAgent") else "", - "Lead Agent Summary": (agent_review.get("leadAgent") or {}).get("summary") or "", + "Legal RAG": (agent_review.get("legalAgentReview") or {}).get("ragStatus") or "", + "Brand RAG": (agent_review.get("brandAgentReview") or {}).get("ragStatus") or "", + "Channel Best Practices RAG": (agent_review.get("channelBestPracticesAgentReview") or {}).get("ragStatus") or "", + "Channel Tech Specs RAG": (agent_review.get("channelTechSpecsAgentReview") or {}).get("ragStatus") or "", + "Lead Agent Summary": agent_review.get("leadAgentSummary") or "", }) return export_rows