Limit raw rewrite selection to AI rejected posts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user