Limit raw rewrite selection to AI rejected posts

This commit is contained in:
Your Name
2026-08-05 16:14:42 +05:00
parent 34f339d434
commit c6f434df08
2 changed files with 5 additions and 10 deletions
+2 -8
View File
@@ -1125,10 +1125,7 @@ def prepare_raw_post(row: Any) -> dict[str, Any]:
post["ai_badge"] = ai_badge(post)
post["can_send_to_rewrite"] = (
post.get("status") == "storage_ready"
and (
(post.get("qualification_status") or "pending") == "rejected"
or (post.get("editorial_status") or "review") == "rejected"
)
and (post.get("qualification_status") or "pending") == "rejected"
)
return post
@@ -2733,10 +2730,7 @@ async def raw_send_to_rewrite(
FROM raw_posts
WHERE id=ANY($1::bigint[])
AND status='storage_ready'
AND (
COALESCE(qualification_status, 'pending')='rejected'
OR COALESCE(editorial_status, 'review')='rejected'
)
AND COALESCE(qualification_status, 'pending')='rejected'
FOR UPDATE
)
UPDATE raw_posts rp